36 using std::this_thread::sleep_for;
43 using error::LUMIERA_ERROR_LOGIC;
46 const int DESTRUCTION_CODE = -23;
50 #define Type(_EXPR_) lib::test::showType<decltype(_EXPR_)>() 79 ,[]{ sleep_for (10ms); }};
82 CHECK (not theThread);
92 if (DESTRUCTION_CODE == secretValue)
94 , LUMIERA_ERROR_SPECIAL};
96 return secretValue+42;
103 int mySecret = rand() % 1000;
106 ,&ThreadWrapperJoin_test::theAction
110 CHECK (mySecret+42 == theThread.join());
118 ,&ThreadWrapperJoin_test::theAction
119 ,
this, DESTRUCTION_CODE};
122 auto res = theThread.join();
123 CHECK (Type(res) ==
"Result<int>"_expect);
126 CHECK (not res.isValid());
136 ,[]{ sleep_for (10ms); }};
Variant of the standard case, requiring to wait and join() on the termination of this thread...
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Implementation namespace for support and library code.
int theAction(int secretValue)
Derived specific exceptions within Lumiera's exception hierarchy.
Abstract Base Class for all testcases.
Simple test class runner.
Convenience front-end to simplify and codify basic thread handling.
A collection of frequently used helper functions to support unit testing.
Lumiera error handling (C++ interface).
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.