X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b9afe407e792292ccb266bb692a20e13c502263..be108f9665882ee412f00635406e894a7aa385de:/tests/uris/uris.cpp diff --git a/tests/uris/uris.cpp b/tests/uris/uris.cpp index 8068f4ef53..959c3e2928 100644 --- a/tests/uris/uris.cpp +++ b/tests/uris/uris.cpp @@ -11,7 +11,7 @@ // headers // ---------------------------------------------------------------------------- -#include "wx/wxprec.h" +#include "testprec.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -24,8 +24,6 @@ #include "wx/uri.h" #include "wx/url.h" -#include "wx/cppunit.h" - // Test wxURL & wxURI compat? #define TEST_URL ( 1 && wxUSE_URL ) @@ -52,6 +50,9 @@ private: CPPUNIT_TEST( Comparison ); #if TEST_URL CPPUNIT_TEST( URLCompat ); +#if wxUSE_PROTOCOL_HTTP + CPPUNIT_TEST( URLProxy ); +#endif #endif CPPUNIT_TEST_SUITE_END(); @@ -68,6 +69,7 @@ private: #if TEST_URL void URLCompat(); + void URLProxy(); #endif DECLARE_NO_COPY_CLASS(URITestCase) @@ -309,6 +311,21 @@ void URITestCase::URLCompat() #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")); + + CPPUNIT_ASSERT( test.BuildURI() == wxT("file:%22myf%22ile.txt") ); + CPPUNIT_ASSERT( test.GetScheme() == wxT("file") ); + CPPUNIT_ASSERT( test.GetPath() == wxT("%22myf%22ile.txt") ); } +#if wxUSE_PROTOCOL_HTTP +void URITestCase::URLProxy() +{ + wxURL url(wxT("http://www.asite.com/index.html")); + url.SetProxy(wxT("pserv:3122")); +} +#endif // wxUSE_PROTOCOL_HTTP #endif +