diff --git a/tests/0-timer.d b/tests/0-timer.d index 20cf63b..d8a7127 100644 --- a/tests/0-timer.d +++ b/tests/0-timer.d @@ -26,7 +26,7 @@ void main() } try { - assert(dur > 1200.msecs, (dur - 1200.msecs).toString()); + assert(dur > 1200.msecs - 2.msecs, (dur - 1200.msecs).toString()); assert(dur < 1300.msecs, (dur - 1200.msecs).toString()); } catch (Exception e) assert(false, e.msg); @@ -38,7 +38,7 @@ void main() try { auto dur = MonoTime.currTime() - s_startTime; s_cnt++; - assert(dur > 300.msecs * s_cnt, (dur - 300.msecs * s_cnt).toString()); + assert(dur > 300.msecs * s_cnt - 2.msecs, (dur - 300.msecs * s_cnt).toString()); assert(dur < 300.msecs * s_cnt + 100.msecs, (dur - 300.msecs * s_cnt).toString()); assert(s_cnt <= 3); diff --git a/tests/issue-25-periodic-timers.d b/tests/issue-25-periodic-timers.d index bc14b0c..bc3736d 100644 --- a/tests/issue-25-periodic-timers.d +++ b/tests/issue-25-periodic-timers.d @@ -44,7 +44,7 @@ void main() auto dur = MonoTime.currTime() - s_startTime; s_cnt++; - assert(dur > 300.msecs * s_cnt, (dur - 300.msecs * s_cnt).toString()); + assert(dur > 300.msecs * s_cnt - 2.msecs, (dur - 300.msecs * s_cnt).toString()); assert(dur < 300.msecs * s_cnt + 100.msecs, (dur - 300.msecs * s_cnt).toString()); assert(s_cnt <= 5);