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
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
//#define TEST_ARRAYS
|
//#define TEST_ARRAYS
|
||||||
//#define TEST_CMDLINE
|
//#define TEST_CMDLINE
|
||||||
//#define TEST_DATETIME
|
#define TEST_DATETIME
|
||||||
//#define TEST_DIR
|
//#define TEST_DIR
|
||||||
//#define TEST_DLLLOADER
|
//#define TEST_DLLLOADER
|
||||||
//#define TEST_EXECUTE
|
//#define TEST_EXECUTE
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
//#define TEST_MIME
|
//#define TEST_MIME
|
||||||
//#define TEST_INFO_FUNCTIONS
|
//#define TEST_INFO_FUNCTIONS
|
||||||
//#define TEST_SOCKETS
|
//#define TEST_SOCKETS
|
||||||
#define TEST_STRINGS
|
//#define TEST_STRINGS
|
||||||
//#define TEST_THREADS
|
//#define TEST_THREADS
|
||||||
//#define TEST_TIMER
|
//#define TEST_TIMER
|
||||||
//#define TEST_WCHAR
|
//#define TEST_WCHAR
|
||||||
@@ -2017,6 +2017,23 @@ static void TestTimeHolidays()
|
|||||||
puts("");
|
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
|
#if 0
|
||||||
|
|
||||||
// test compatibility with the old wxDate/wxTime classes
|
// 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
|
// if we emulate strtok(), check that we do it correctly
|
||||||
wxChar *buf, *s, *last;
|
wxChar *buf, *s = NULL, *last;
|
||||||
|
|
||||||
if ( tkz.GetMode() == wxTOKEN_STRTOK )
|
if ( tkz.GetMode() == wxTOKEN_STRTOK )
|
||||||
{
|
{
|
||||||
@@ -2873,7 +2890,9 @@ int main(int argc, char **argv)
|
|||||||
TestTimeFormat();
|
TestTimeFormat();
|
||||||
TestTimeArithmetics();
|
TestTimeArithmetics();
|
||||||
TestTimeHolidays();
|
TestTimeHolidays();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
TestTimeZoneBug();
|
||||||
if ( 0 )
|
if ( 0 )
|
||||||
TestInteractive();
|
TestInteractive();
|
||||||
#endif // TEST_DATETIME
|
#endif // TEST_DATETIME
|
||||||
|
Reference in New Issue
Block a user