ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
check_timeout.h File Reference
#include <boost/test/test_tools.hpp>
+ Include dependency graph for check_timeout.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHECK_TIMEOUT(condition, maxMilliseconds)
 
#define CHECK_EQUAL_TIMEOUT(left, right, maxMilliseconds)
 

Macro Definition Documentation

◆ CHECK_EQUAL_TIMEOUT

#define CHECK_EQUAL_TIMEOUT (   left,
  right,
  maxMilliseconds 
)
Value:
{ \
CHECK_TIMEOUT((left) == (right), maxMilliseconds); \
BOOST_CHECK_EQUAL(left, right); \
} \
(void)0

Definition at line 19 of file check_timeout.h.

◆ CHECK_TIMEOUT

#define CHECK_TIMEOUT (   condition,
  maxMilliseconds 
)
Value:
{ \
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); \
} \
} \
(void)0

Definition at line 7 of file check_timeout.h.