Correct the test for ParseFormat() with fall back date

This was added back in b5f85206a9 (fix ParseFormat("%d") to set the date
it finds (#10002), 2008-09-26), but the test didn't do what the comment
said and didn't use the default date object it added.

Fix this now to finally do what was intended all these years ago.
This commit is contained in:
Vadim Zeitlin
2020-05-09 23:20:06 +02:00
parent da48b9e45d
commit 2cf0537722

View File

@@ -870,8 +870,10 @@ void DateTimeTestCase::TestTimeFormat()
// test partially specified dates too
wxDateTime dtDef(26, wxDateTime::Sep, 2008);
CPPUNIT_ASSERT( dt.ParseFormat("17", "%d") );
CPPUNIT_ASSERT( dt.ParseFormat("17", "%d", dtDef) );
CPPUNIT_ASSERT_EQUAL( 17, dt.GetDay() );
CPPUNIT_ASSERT_EQUAL( wxDateTime::Sep, dt.GetMonth() );
CPPUNIT_ASSERT_EQUAL( 2008, dt.GetYear() );
// test some degenerate cases
CPPUNIT_ASSERT( !dt.ParseFormat("", "%z") );