From 2a4aa8f2d10ea362f2be324aef8e896ed0d91b83 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 25 Dec 2023 00:18:25 +0200 Subject: [PATCH] Fixed stopwatch test --- tests/test_stopwatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_stopwatch.cpp b/tests/test_stopwatch.cpp index 5deb645d..ba4c8f62 100644 --- a/tests/test_stopwatch.cpp +++ b/tests/test_stopwatch.cpp @@ -12,7 +12,7 @@ TEST_CASE("stopwatch1", "[stopwatch]") { std::this_thread::sleep_for(wait_ms); auto stop = clock::now(); auto diff_ms = std::chrono::duration_cast(stop - start); - REQUIRE(sw.elapsed() >= diff_ms); + REQUIRE(sw.elapsed() >= diff_ms - milliseconds(1)); REQUIRE(sw.elapsed() <= diff_ms + tolerance_ms); }