From db4588662585530a8d0684f06f8283dae17113f1 Mon Sep 17 00:00:00 2001 From: "Penn, John M 047828115" Date: Wed, 4 Aug 2021 10:51:52 -0500 Subject: [PATCH] Clock spin test can't assume code performance on an arbitrary machine. #87 --- .../sim_services/Clock/test/GetTimeOfDayClock_test.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/trick_source/sim_services/Clock/test/GetTimeOfDayClock_test.cpp b/trick_source/sim_services/Clock/test/GetTimeOfDayClock_test.cpp index 1c799aff..e09e0101 100644 --- a/trick_source/sim_services/Clock/test/GetTimeOfDayClock_test.cpp +++ b/trick_source/sim_services/Clock/test/GetTimeOfDayClock_test.cpp @@ -117,12 +117,9 @@ TEST_F(GetTimeOfDayClockTest, ClockSpin) { dClk.clock_spin(tim_curr + spin_time); - // I think we have to account for a race condition between - // wall_clock_time() and the execution time of this test code. (J.Penn) // We know that the time difference must be at least as long as the spin_time. + // But that's all we know. EXPECT_GE((timclk->wall_clock_time() - tim_curr), spin_time); - // But, it can't be much longer. Allow 10 micro-seconds to allow for code execution time. - EXPECT_LE((timclk->wall_clock_time() - tim_curr), spin_time+10); delete timclk; }