diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-09-18 13:29:53 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-09-19 14:47:52 +1000 |
commit | aa77c2eb581a1952c48706cb0b74af1d74f27334 (patch) | |
tree | fe9cb5aa16ba67b5d8ee2ebb4578515aabec1606 /libs/pbd | |
parent | aca6e667a88100c061b71de0346312727f1938d6 (diff) |
Give the Windows MMTimer test a better chance of passing
The default scheduling on windows seems fairly erratic or is at least in the
VM that I'm running these tests on, so increase the timing slack a bit so the
test has a better chance of passing. It is still quite easy for it to fail
though, especially if you for instance manipulate the terminal window somehow
while running the tests but it does not really matter in any case as this test
serves its purpose in testing the PBD::MMTimers API.
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/test/windows_timer_utils_test.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/pbd/test/windows_timer_utils_test.cc b/libs/pbd/test/windows_timer_utils_test.cc index cd2ba59040..003c116ef8 100644 --- a/libs/pbd/test/windows_timer_utils_test.cc +++ b/libs/pbd/test/windows_timer_utils_test.cc @@ -143,19 +143,18 @@ WindowsTimerUtilsTest::testMMTimers () test_tgt_granularity ("Minimum Timer Resolution", avg_min_res_tgt_elapsed); - // test that it the avg granularity is the same as miniumum resolution - CPPUNIT_ASSERT (avg_min_res_tgt_elapsed == 1); + // In a heavily loaded system and without running this test with raised + // scheduling priority we can't assume that the granularity is the same as + // the minimum timer resolution so give it a few ms of slack, if it is + // greater than that then there likely is a problem that needs investigating. + CPPUNIT_ASSERT (avg_min_res_tgt_elapsed <= 5); uint32_t avg_min_res_sleep_elapsed = 0; + // This should have roughly the same granularity as the tgt test above test_sleep_granularity ("Minimum Timer Resolution", avg_min_res_sleep_elapsed); - // In a heavily loaded system and without running this test with raised - // scheduling priority we can't assume that the sleep granularity is the - // same as the minimum timer resolution so give it 1ms of slack, if it is - // greater than that then there likely is a problem that needs - // investigating. - CPPUNIT_ASSERT (avg_min_res_sleep_elapsed <= 2); + CPPUNIT_ASSERT (avg_min_res_sleep_elapsed <= 5); CPPUNIT_ASSERT (PBD::MMTIMERS::reset_resolution()); |