@@ -1488,19 +1488,23 @@ BOOST_AUTO_TEST_CASE(util_time_GetTime)
1488
1488
{
1489
1489
SetMockTime (111 );
1490
1490
// Check that mock time does not change after a sleep
1491
- for (const auto & num_sleep : {0 , 1 }) {
1492
- UninterruptibleSleep (std::chrono::milliseconds{ num_sleep} );
1491
+ for (const auto & num_sleep : {0ms, 1ms }) {
1492
+ UninterruptibleSleep (num_sleep);
1493
1493
BOOST_CHECK_EQUAL (111 , GetTime ()); // Deprecated time getter
1494
1494
BOOST_CHECK_EQUAL (111 , GetTime<std::chrono::seconds>().count ());
1495
1495
BOOST_CHECK_EQUAL (111000 , GetTime<std::chrono::milliseconds>().count ());
1496
1496
BOOST_CHECK_EQUAL (111000000 , GetTime<std::chrono::microseconds>().count ());
1497
1497
}
1498
1498
1499
1499
SetMockTime (0 );
1500
- // Check that system time changes after a sleep
1500
+ // Check that steady time and system time changes after a sleep
1501
+ const auto steady_ms_0 = Now<SteadyMilliseconds>();
1502
+ const auto steady_0 = std::chrono::steady_clock::now ();
1501
1503
const auto ms_0 = GetTime<std::chrono::milliseconds>();
1502
1504
const auto us_0 = GetTime<std::chrono::microseconds>();
1503
- UninterruptibleSleep (std::chrono::milliseconds{1 });
1505
+ UninterruptibleSleep (1ms);
1506
+ BOOST_CHECK (steady_ms_0 < Now<SteadyMilliseconds>());
1507
+ BOOST_CHECK (steady_0 + 1ms <= std::chrono::steady_clock::now ());
1504
1508
BOOST_CHECK (ms_0 < GetTime<std::chrono::milliseconds>());
1505
1509
BOOST_CHECK (us_0 < GetTime<std::chrono::microseconds>());
1506
1510
}
0 commit comments