Skip to content

Commit 69f9d8c

Browse files
authored
Improve error reporting for clock test (#1248)
1 parent b482851 commit 69f9d8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/old_tests/UnitTests/clock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ TEST_CASE("clock, time_t")
7676
REQUIRE(clock::to_time_t(clock::from_time_t(now_tt)) == now_tt);
7777

7878
// Conversions are verified to be consistent. Now, verify that we're correctly converting epochs
79-
const auto diff = abs(clock::now() - clock::from_time_t(time(nullptr)));
80-
REQUIRE(diff < seconds{ 1 });
79+
const auto diff = duration_cast<milliseconds>(abs(clock::now() - clock::from_time_t(time(nullptr)))).count();
80+
REQUIRE(diff < 1000);
8181
}
8282

8383
TEST_CASE("clock, FILETIME")

0 commit comments

Comments
 (0)