From f92d1d346572cec7d612dc08df6f00bc9e1fc559 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Fri, 14 Aug 2020 07:57:38 +0300 Subject: [PATCH 1/3] remove another timing assumption --- tests/std/include/test_atomic_wait.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/std/include/test_atomic_wait.hpp b/tests/std/include/test_atomic_wait.hpp index 7be16c0d1af..ab66cfcf11f 100644 --- a/tests/std/include/test_atomic_wait.hpp +++ b/tests/std/include/test_atomic_wait.hpp @@ -147,10 +147,15 @@ void test_pad_bits_impl(const std::chrono::steady_clock::duration waiting_durati c.store(new_value); c.notify_one(); + +#ifdef CAN_FAIL_ON_TIMING_ASSUMPTION std::this_thread::sleep_for(waiting_duration); assert(trigger); - w1.join(); +#else // ^^^ CAN_FAIL_ON_TIMING_ASSUMPTION / !CAN_FAIL_ON_TIMING_ASSUMPTION vvv + w1.join(); + assert(trigger); +#endif // ^^^ CAN_FAIL_ON_TIMING_ASSUMPTION ^^^ } template From 5e21173c7180cb5870a14fb5996ab14ff4363263 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Fri, 14 Aug 2020 07:59:04 +0300 Subject: [PATCH 2/3] -newline --- tests/std/include/test_atomic_wait.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/std/include/test_atomic_wait.hpp b/tests/std/include/test_atomic_wait.hpp index ab66cfcf11f..ba25ce945b6 100644 --- a/tests/std/include/test_atomic_wait.hpp +++ b/tests/std/include/test_atomic_wait.hpp @@ -147,7 +147,6 @@ void test_pad_bits_impl(const std::chrono::steady_clock::duration waiting_durati c.store(new_value); c.notify_one(); - #ifdef CAN_FAIL_ON_TIMING_ASSUMPTION std::this_thread::sleep_for(waiting_duration); assert(trigger); From b651da7b5ad8261ccf9085d91ffe5ca31b44de3d Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Fri, 14 Aug 2020 08:00:27 +0300 Subject: [PATCH 3/3] negate comment --- tests/std/include/test_atomic_wait.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/include/test_atomic_wait.hpp b/tests/std/include/test_atomic_wait.hpp index ba25ce945b6..a3d9b4471c2 100644 --- a/tests/std/include/test_atomic_wait.hpp +++ b/tests/std/include/test_atomic_wait.hpp @@ -154,7 +154,7 @@ void test_pad_bits_impl(const std::chrono::steady_clock::duration waiting_durati #else // ^^^ CAN_FAIL_ON_TIMING_ASSUMPTION / !CAN_FAIL_ON_TIMING_ASSUMPTION vvv w1.join(); assert(trigger); -#endif // ^^^ CAN_FAIL_ON_TIMING_ASSUMPTION ^^^ +#endif // ^^^ !CAN_FAIL_ON_TIMING_ASSUMPTION ^^^ } template