From 60c0dfe53b13a1279699e52711565910d1a70e07 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 4 May 2005 19:37:00 +0000 Subject: [PATCH] added (trivial) GetLong/ShortPath() test git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/filename/filenametest.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp index 0e9681ee43..84380c1b84 100644 --- a/tests/filename/filenametest.cpp +++ b/tests/filename/filenametest.cpp @@ -89,12 +89,18 @@ private: CPPUNIT_TEST( TestSplit ); CPPUNIT_TEST( TestSetPath ); CPPUNIT_TEST( TestStrip ); +#ifdef __WINDOWS__ + CPPUNIT_TEST( TestShortLongPath ); +#endif // __WINDOWS__ CPPUNIT_TEST_SUITE_END(); void TestConstruction(); void TestSplit(); void TestSetPath(); void TestStrip(); +#ifdef __WINDOWS__ + void TestShortLongPath(); +#endif // __WINDOWS__ DECLARE_NO_COPY_CLASS(FileNameTestCase) }; @@ -182,3 +188,17 @@ void FileNameTestCase::TestStrip() CPPUNIT_ASSERT( wxTestStripExtension( _T("good.wav") ) == _T("good") ); CPPUNIT_ASSERT( wxTestStripExtension( _T("good.wav.wav") ) == _T("good.wav") ); } + +#ifdef __WINDOWS__ + +void FileNameTestCase::TestShortLongPath() +{ + wxFileName fn("C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe"); + + // incredibly enough, GetLongPath() used to return different results during + // the first and subsequent runs, test for this + CPPUNIT_ASSERT_EQUAL( fn.GetLongPath(), fn.GetLongPath() ); + CPPUNIT_ASSERT_EQUAL( fn.GetShortPath(), fn.GetShortPath() ); +} + +#endif // __WINDOWS__ -- 2.45.2