From 4dbc8006b48978614417a7a9c90a96bb1efe1ea9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Apr 2000 20:46:55 +0000 Subject: [PATCH] added test for wxDateTime TZ/DST bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/console/console.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 440b2bff3b..842b7e13f6 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -37,7 +37,7 @@ //#define TEST_ARRAYS //#define TEST_CMDLINE -//#define TEST_DATETIME +#define TEST_DATETIME //#define TEST_DIR //#define TEST_DLLLOADER //#define TEST_EXECUTE @@ -48,7 +48,7 @@ //#define TEST_MIME //#define TEST_INFO_FUNCTIONS //#define TEST_SOCKETS -#define TEST_STRINGS +//#define TEST_STRINGS //#define TEST_THREADS //#define TEST_TIMER //#define TEST_WCHAR @@ -2017,6 +2017,23 @@ static void TestTimeHolidays() puts(""); } +static void TestTimeZoneBug() +{ + puts("\n*** testing for DST/timezone bug ***\n"); + + wxDateTime date = wxDateTime(1, wxDateTime::Mar, 2000); + for ( int i = 0; i < 31; i++ ) + { + printf("Date %s: week day %s.\n", + date.Format(_T("%d-%m-%Y")).c_str(), + date.GetWeekDayName(date.GetWeekDay()).c_str()); + + date += wxDateSpan::Day(); + } + + puts(""); +} + #if 0 // test compatibility with the old wxDate/wxTime classes @@ -2557,7 +2574,7 @@ static void TestStringTokenizer() } // if we emulate strtok(), check that we do it correctly - wxChar *buf, *s, *last; + wxChar *buf, *s = NULL, *last; if ( tkz.GetMode() == wxTOKEN_STRTOK ) { @@ -2873,7 +2890,9 @@ int main(int argc, char **argv) TestTimeFormat(); TestTimeArithmetics(); TestTimeHolidays(); + } + TestTimeZoneBug(); if ( 0 ) TestInteractive(); #endif // TEST_DATETIME