From dc310ea07f7b47d0ea53ed744c27a0edef023ade Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 24 Mar 2009 12:19:21 +0000 Subject: [PATCH] discard the time zone part of strings being parsed (generalizes the "CEST"-ignoring hack of r59682) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/datetime/datetimetest.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index 90df81d4ea..685b9b35eb 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -739,12 +739,14 @@ void DateTimeTestCase::TestTimeFormat() } else // conversion succeeded { - // 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 - // "---> sab 29 mag 1976 18:30:00 CET" - // so we just need to ignore CET) - CPPUNIT_ASSERT( !*result || strcmp(result, "CET") == 0 ); + // currently ParseFormat() doesn't support "%Z" and so is + // incapable of parsing time zone part used at the end of date + // representations in many (but not "C") locales, compensate + // for it ourselves by simply consuming and ignoring it + while ( *result && (*result >= 'A' && *result <= 'Z') ) + result++; + + CPPUNIT_ASSERT( !*result ); switch ( kind ) { -- 2.47.2