27 using std::this_thread::sleep_for;
34 using error::LUMIERA_ERROR_LOGIC;
37 const int DESTRUCTION_CODE = -23;
41 #define Type(_EXPR_) lib::test::showType<decltype(_EXPR_)>() 72 ,[]{ sleep_for (10ms); }};
75 CHECK (not theThread);
85 if (DESTRUCTION_CODE == secretValue)
87 , LUMIERA_ERROR_SPECIAL};
89 return secretValue+42;
96 int mySecret =
rani(1000);
99 ,&ThreadWrapperJoin_test::theAction
103 CHECK (mySecret+42 == theThread.join());
111 ,&ThreadWrapperJoin_test::theAction
112 ,
this, DESTRUCTION_CODE};
115 auto res = theThread.join();
116 CHECK (Type(res) ==
"Result<int>"_expect);
119 CHECK (not res.isValid());
129 ,[]{ sleep_for (10ms); }};
Variant of the standard case, requiring to wait and join() on the termination of this thread...
int rani(uint bound=_iBOUND())
#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.
Simplistic 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.