// JDNs must be computed for UTC times
double jdn = dt.FromUTC().GetJulianDayNumber();
- CPPUNIT_ASSERT( jdn == d.jdn );
+ CPPUNIT_ASSERT_EQUAL( d.jdn, jdn );
dt.Set(jdn);
- CPPUNIT_ASSERT( dt.GetJulianDayNumber() == jdn );
+ CPPUNIT_ASSERT_EQUAL( jdn, dt.GetJulianDayNumber() );
}
}
const char *result = dt2.ParseFormat(s, fmt);
if ( !result )
{
- // converion failed - should it have?
+ // conversion failed - should it have?
CPPUNIT_ASSERT( kind == CompareNone );
}
else // conversion succeeded
}
}
+ wxDateTime dt;
+
+ // test partially specified dates too
+ wxDateTime dtDef(26, wxDateTime::Sep, 2008);
+ CPPUNIT_ASSERT( dt.ParseFormat("17", "%d") );
+ CPPUNIT_ASSERT_EQUAL( 17, dt.GetDay() );
+
// test compilation of some calls which should compile (and not result in
// ambiguity because of char*<->wxCStrData<->wxString conversions)
- wxDateTime dt;
wxString s("foo");
CPPUNIT_ASSERT( !dt.ParseFormat("foo") );
CPPUNIT_ASSERT( !dt.ParseFormat(wxT("foo")) );
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
- wxDateTime dt;
if ( dt.ParseDate(parseTestDates[n].str) )
{
CPPUNIT_ASSERT( parseTestDates[n].good );
wxDateTime dt;
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
- wxDateTime dt;
if ( dt.ParseDateTime(parseTestDates[n].str) )
{
CPPUNIT_ASSERT( parseTestDates[n].good );