Tweak sleep test to be more forgiving of variances, +/- 20ms

This commit is contained in:
baldurk
2017-09-29 20:28:18 +01:00
parent a018deb19f
commit d0e4a81266
+4 -4
View File
@@ -284,7 +284,7 @@ TEST_CASE("Test OS-specific functions", "[osspecific]")
uint64_t firstTick = Timing::GetTick();
Threading::Sleep(500);
Threading::Sleep(1500);
uint64_t lastTick = Timing::GetTick();
@@ -294,8 +294,8 @@ TEST_CASE("Test OS-specific functions", "[osspecific]")
CHECK(milliseconds1 > 0.0);
CHECK(milliseconds1 < 1.0);
CHECK(milliseconds2 > 490.0);
CHECK(milliseconds2 < 510.0);
CHECK(milliseconds2 > 1480.0);
CHECK(milliseconds2 < 1520.0);
}
// timestamp as of the creation of this test
@@ -615,4 +615,4 @@ TEST_CASE("Test OS-specific functions", "[osspecific]")
};
};
#endif // ENABLED(ENABLE_UNIT_TESTS)
#endif // ENABLED(ENABLE_UNIT_TESTS)