test for 'backwards clock' bug

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2000-03-05 02:31:16 +00:00
parent d31b7b682c
commit 87798c0030

View File

@ -738,17 +738,32 @@ static void TestStopWatch()
wxStopWatch sw;
printf("Sleeping 3 seconds...");
wxSleep(3);
printf("\telapsed time: %ld\n", sw.Time());
printf("\telapsed time: %ldms\n", sw.Time());
sw.Pause();
printf("Sleeping 2 more seconds...");
wxSleep(2);
printf("\telapsed time: %ld\n", sw.Time());
printf("\telapsed time: %ldms\n", sw.Time());
sw.Resume();
printf("And 3 more seconds...");
wxSleep(3);
printf("\telapsed time: %ld\n", sw.Time());
printf("\telapsed time: %ldms\n", sw.Time());
wxStopWatch sw2;
puts("\nChecking for 'backwards clock' bug...");
for ( size_t n = 0; n < 70; n++ )
{
sw2.Start();
if ( sw.Time() < 0 || sw2.Time() < 0 )
{
puts("\ntime is negative - ERROR!");
}
putchar('.');
}
puts(", ok.");
}
#endif // TEST_TIMER