Merge the new GUI tests from SOC2010_GUI_TEST branch.

Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-08-22 22:16:05 +00:00
parent 571d991bb3
commit 232fdc630c
79 changed files with 9150 additions and 491 deletions

View File

@@ -55,27 +55,45 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( StopWatchTestCase, "StopWatchTestCase" );
void StopWatchTestCase::Misc()
{
static const long tolerance = 100; // in ms
wxStopWatch sw;
long tmp;
long t;
sw.Pause(); // pause it immediately
wxSleep(2);
tmp = sw.Time();
CPPUNIT_ASSERT(tmp >= 0 && tmp < 100);
// should not have counted while paused!
t = sw.Time();
// check that the stop watch doesn't advance while paused
WX_ASSERT_MESSAGE
(
("Actual time value is %ld", t),
t >= 0 && t < tolerance
);
sw.Resume();
wxSleep(3);
tmp = sw.Time();
CPPUNIT_ASSERT(tmp >= 3000 && tmp < 4000);
t = sw.Time();
// check that it did advance now by ~3s
WX_ASSERT_MESSAGE
(
("Actual time value is %ld", t),
t > 3000 - tolerance && t < 3000 + tolerance
);
sw.Pause();
sw.Resume();
wxSleep(2);
tmp = sw.Time();
CPPUNIT_ASSERT(tmp >= 5000 && tmp < 6000);
t = sw.Time();
// and it should advance again
WX_ASSERT_MESSAGE
(
("Actual time value is %ld", t),
t > 5000 - tolerance && t < 5000 + tolerance
);
}
void StopWatchTestCase::BackwardsClockBug()