]> git.saurik.com Git - wxWidgets.git/commitdiff
Added ParseFormat("%s") tests.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Jul 2009 16:41:52 +0000 (16:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Jul 2009 16:41:52 +0000 (16:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/datetime/datetimetest.cpp

index f5e250ba963b3925bf6f0fa57847635dfa27174d..ad33117471ec6cd4a3dca0ad6db093d2ac5a0a91 100644 (file)
@@ -786,6 +786,14 @@ void DateTimeTestCase::TestTimeFormat()
     CPPUNIT_ASSERT_EQUAL( 1856, dt.GetYear() );
 #endif
 
+    // also test %l separately
+    CPPUNIT_ASSERT( dt.ParseFormat("12:23:45.678", "%H:%M:%S.%l") );
+    CPPUNIT_ASSERT_EQUAL( 678, dt.GetMillisecond() );
+
+    // test special case of %l matching 0 milliseconds
+    CPPUNIT_ASSERT( dt.ParseFormat("12:23:45.000", "%H:%M:%S.%l") );
+    CPPUNIT_ASSERT_EQUAL( 0, dt.GetMillisecond() );
+
     // test partially specified dates too
     wxDateTime dtDef(26, wxDateTime::Sep, 2008);
     CPPUNIT_ASSERT( dt.ParseFormat("17", "%d") );