From d8a6fee3c9b79e1a13d8e5705cd41459c8919136 Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Tue, 4 Feb 2020 11:32:52 +0100
Subject: [PATCH] use CHECK_TIMEOUT from header file

---
 tests/executables_src/testDirectDeviceToCS.cc | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/tests/executables_src/testDirectDeviceToCS.cc b/tests/executables_src/testDirectDeviceToCS.cc
index 69f909cf..f69699d7 100644
--- a/tests/executables_src/testDirectDeviceToCS.cc
+++ b/tests/executables_src/testDirectDeviceToCS.cc
@@ -16,6 +16,7 @@
 #include "PeriodicTrigger.h"
 #include "TestFacility.h"
 #include <ChimeraTK/Device.h>
+#include "check_timeout.h"
 
 using namespace boost::unit_test_framework;
 namespace ctk = ChimeraTK;
@@ -23,17 +24,6 @@ namespace ctk = ChimeraTK;
 // list of user types the accessors are tested with
 typedef boost::mpl::list<int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, float, double> test_types;
 
-#define CHECK_TIMEOUT(condition, maxMilliseconds)                                                                      \
-  {                                                                                                                    \
-    std::chrono::steady_clock::time_point t0 = std::chrono::steady_clock::now();                                       \
-    while(!(condition)) {                                                                                              \
-      bool timeout_reached = (std::chrono::steady_clock::now() - t0) > std::chrono::milliseconds(maxMilliseconds);     \
-      BOOST_CHECK(!timeout_reached);                                                                                   \
-      if(timeout_reached) break;                                                                                       \
-      usleep(1000);                                                                                                    \
-    }                                                                                                                  \
-  }
-
 /*********************************************************************************************************************/
 /* dummy application */
 
-- 
GitLab