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:
@@ -870,8 +870,10 @@ void DateTimeTestCase::TestTimeFormat()
|
|||||||
|
|
||||||
// test partially specified dates too
|
// test partially specified dates too
|
||||||
wxDateTime dtDef(26, wxDateTime::Sep, 2008);
|
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( 17, dt.GetDay() );
|
||||||
|
CPPUNIT_ASSERT_EQUAL( wxDateTime::Sep, dt.GetMonth() );
|
||||||
|
CPPUNIT_ASSERT_EQUAL( 2008, dt.GetYear() );
|
||||||
|
|
||||||
// test some degenerate cases
|
// test some degenerate cases
|
||||||
CPPUNIT_ASSERT( !dt.ParseFormat("", "%z") );
|
CPPUNIT_ASSERT( !dt.ParseFormat("", "%z") );
|
||||||
|
Reference in New Issue
Block a user