X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4827cbd9236a35e81322c4d054a4d88fa1228055..702723413ed52b1f538d9c8deab8abfa3f8beb9a:/tests/filesys/filesys.cpp diff --git a/tests/filesys/filesys.cpp b/tests/filesys/filesys.cpp index 64b12d8b0f..90ade21d31 100644 --- a/tests/filesys/filesys.cpp +++ b/tests/filesys/filesys.cpp @@ -11,7 +11,16 @@ // headers // ---------------------------------------------------------------------------- -#include "wx/wx.h" +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif // WX_PRECOMP + #include "wx/filesys.h" #include "wx/cppunit.h" @@ -53,11 +62,13 @@ public: private: CPPUNIT_TEST_SUITE( FileSystemTestCase ); CPPUNIT_TEST( UrlParsing ); + CPPUNIT_TEST( FileNameToUrlConversion ); CPPUNIT_TEST_SUITE_END(); void UrlParsing(); + void FileNameToUrlConversion(); - DECLARE_NO_COPY_CLASS(FileSystemTestCase); + DECLARE_NO_COPY_CLASS(FileSystemTestCase) }; // register in the unnamed registry so that these tests are run by default @@ -70,8 +81,8 @@ void FileSystemTestCase::UrlParsing() { static const struct Data { - const wchar_t *url; - const wchar_t *protocol, *left, *right, *anchor; + const wxChar *url; + const wxChar *protocol, *left, *right, *anchor; } data[] = { // simple case: @@ -101,5 +112,15 @@ void FileSystemTestCase::UrlParsing() CPPUNIT_ASSERT( tst.Anchor(d.url) == d.anchor ); } } + +void FileSystemTestCase::FileNameToUrlConversion() +{ +#ifdef __WINDOWS__ + wxFileName fn1(_T("\\\\server\\share\\path\\to\\file")); + wxString url1 = wxFileSystem::FileNameToURL(fn1); + + CPPUNIT_ASSERT( fn1.SameAs(wxFileSystem::URLToFileName(url1)) ); +#endif +} #endif // wxUSE_FILESYSTEM