]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/uris/uris.cpp
enabled VS2005 project files
[wxWidgets.git] / tests / uris / uris.cpp
index ec59baf1edb6d5a1f2ddec14f4e2aa9567155a77..8ea7438debddef925e027119ba9f8d56ac7d1ea7 100644 (file)
@@ -49,9 +49,10 @@ private:
         CPPUNIT_TEST( Assignment );
         CPPUNIT_TEST( Comparison );
         CPPUNIT_TEST( Unescaping );
+        CPPUNIT_TEST( FileScheme );
 #if TEST_URL
         CPPUNIT_TEST( URLCompat );
-#if wxUSE_PROTOCOL_HTTP
+#if 0 && wxUSE_PROTOCOL_HTTP
         CPPUNIT_TEST( URLProxy  );
 #endif
 #endif
@@ -68,10 +69,13 @@ private:
     void Assignment();
     void Comparison();
     void Unescaping();
+    void FileScheme();
 
 #if TEST_URL
     void URLCompat();
+#if 0 && wxUSE_PROTOCOL_HTTP
     void URLProxy();
+#endif
 #endif
 
     DECLARE_NO_COPY_CLASS(URITestCase)
@@ -299,6 +303,26 @@ void URITestCase::Unescaping()
     CPPUNIT_ASSERT(works2.IsSameAs(broken2));
 
 }
+
+void URITestCase::FileScheme()
+{
+    //file:// variety (NOT CONFORMANT TO THE RFC)
+    CPPUNIT_ASSERT(wxURI(wxString(wxT("file://e:/wxcode/script1.xml"))).GetPath() 
+                    == wxT("e:/wxcode/script1.xml") );
+
+    //file:/// variety
+    CPPUNIT_ASSERT(wxURI(wxString(wxT("file:///e:/wxcode/script1.xml"))).GetPath() 
+                    == wxT("/e:/wxcode/script1.xml") );
+
+    //file:/ variety
+    CPPUNIT_ASSERT(wxURI(wxString(wxT("file:/e:/wxcode/script1.xml"))).GetPath() 
+                    == wxT("/e:/wxcode/script1.xml") );
+
+    //file: variety
+    CPPUNIT_ASSERT(wxURI(wxString(wxT("file:e:/wxcode/script1.xml"))).GetPath() 
+                    == wxT("e:/wxcode/script1.xml") );
+}
+
 #if TEST_URL
 
 const wxChar* pszProblemUrls[] = { wxT("http://www.csdn.net"),
@@ -334,9 +358,6 @@ void URITestCase::URLCompat()
     CPPUNIT_ASSERT( uricopy == url );
     CPPUNIT_ASSERT( uricopy == urlcopy );
     CPPUNIT_ASSERT( uricopy == uri );
-#if WXWIN_COMPATIBILITY_2_4
-    CPPUNIT_ASSERT( wxURL::ConvertFromURI(wxT("%20%41%20")) == wxT(" A ") );
-#endif
     CPPUNIT_ASSERT( wxURI::Unescape(wxT("%20%41%20")) == wxT(" A ") );
 
     wxURI test(wxT("file:\"myf\"ile.txt"));
@@ -376,7 +397,9 @@ void URITestCase::URLCompat()
 #endif
 }
 
-#if wxUSE_PROTOCOL_HTTP
+// the purpose of this test is unclear, it seems to be unfinished so disabling
+// it for now
+#if 0 && wxUSE_PROTOCOL_HTTP
 void URITestCase::URLProxy()
 {
     wxURL url(wxT("http://www.asite.com/index.html"));