git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59796
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
for ( size_t n = 0; n < WXSIZEOF(formatTestFormats); n++ )
{
const char *fmt = formatTestFormats[n].format;
for ( size_t n = 0; n < WXSIZEOF(formatTestFormats); n++ )
{
const char *fmt = formatTestFormats[n].format;
// skip the check with %p for those locales which have empty AM/PM strings:
// for those locales it's impossible to pass the test with %p...
wxString am, pm;
// skip the check with %p for those locales which have empty AM/PM strings:
// for those locales it's impossible to pass the test with %p...
wxString am, pm;
{
// ParseFormat() should have parsed the entire string or left
// some final useless strings (e.g. with Italian locale the
{
// ParseFormat() should have parsed the entire string or left
// some final useless strings (e.g. with Italian locale the
- // 's' string for the first test date looks like
+ // 's' string for the first test date looks like
// "---> sab 29 mag 1976 18:30:00 CET"
// so we just need to ignore CET)
CPPUNIT_ASSERT( !*result || strcmp(result, "CET") == 0 );
// "---> sab 29 mag 1976 18:30:00 CET"
// so we just need to ignore CET)
CPPUNIT_ASSERT( !*result || strcmp(result, "CET") == 0 );
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
- if ( dt.ParseDate(parseTestDates[n].str) )
+ const char * const datestr = parseTestDates[n].str;
+
+ const char * const end = dt.ParseDate(datestr);
+ if ( end && !*end )
- CPPUNIT_ASSERT( parseTestDates[n].good );
+ WX_ASSERT_MESSAGE(
+ ("Erroneously parsed \"%s\"", datestr),
+ parseTestDates[n].good
+ );
CPPUNIT_ASSERT_EQUAL( parseTestDates[n].date.DT(), dt );
}
else // failed to parse
{
CPPUNIT_ASSERT_EQUAL( parseTestDates[n].date.DT(), dt );
}
else // failed to parse
{
- CPPUNIT_ASSERT( !parseTestDates[n].good );
+ WX_ASSERT_MESSAGE(
+ ("Failed to parse \"%s\"", datestr),
+ !parseTestDates[n].good
+ );
wxDateTime dt;
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
wxDateTime dt;
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
- if ( dt.ParseDateTime(parseTestDates[n].str) )
+ const char * const datestr = parseTestDates[n].str;
+
+ if ( dt.ParseDateTime(datestr) )
- CPPUNIT_ASSERT( parseTestDates[n].good );
+ WX_ASSERT_MESSAGE(
+ ("Erroneously parsed \"%s\"", datestr),
+ parseTestDates[n].good
+ );
CPPUNIT_ASSERT_EQUAL( parseTestDates[n].date.DT(), dt );
}
else // failed to parse
{
CPPUNIT_ASSERT_EQUAL( parseTestDates[n].date.DT(), dt );
}
else // failed to parse
{
+ WX_ASSERT_MESSAGE(
+ ("Failed to parse \"%s\"", datestr),
+ !parseTestDates[n].good
+ );
+
CPPUNIT_ASSERT( !parseTestDates[n].good );
}
}
CPPUNIT_ASSERT( !parseTestDates[n].good );
}
}