Update test_stopwatch.cpp

This commit is contained in:
Gabi Melman 2023-05-27 23:05:49 +03:00 committed by GitHub
parent 8222ca4837
commit c174c15138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,6 @@ TEST_CASE("stopwatch2", "[stopwatch]")
auto val = std::stod(test_sink->lines()[0]); auto val = std::stod(test_sink->lines()[0]);
auto diff_duration = duration_cast<std::chrono::duration<double>>(stop - start); auto diff_duration = duration_cast<std::chrono::duration<double>>(stop - start);
REQUIRE(val >= (diff_duration - milliseconds(3)).count()); REQUIRE(val >= (diff_duration).count() - 0.001);
REQUIRE(val <= (diff_duration + tolerance_duration).count()); REQUIRE(val <= (diff_duration + tolerance_duration).count());
} }