OpenWalnut
1.5.0dev
|
Tests the WThreadedFunction class. More...
#include <WThreadedFunction_test.h>
Classes | |
class | ExceptionalFuncType |
A function that throws exceptions. More... | |
class | FuncType |
A threaded function. More... | |
Public Member Functions | |
void | testMultipleThreads () |
A function computed by multiple threads should correctly set its status and compute the correct results. More... | |
void | testStopThreads () |
Status should be set correctly when threads are ordered to stop. More... | |
void | testStopCondition () |
The stop condition should be notified correctly. More... | |
void | testExceptionHandling () |
Exceptions should lead to the status beeing changed to W_THREADS_ABORTED. More... | |
Private Member Functions | |
void | handleException (WException const &) |
Exception callback. More... | |
Private Attributes | |
WSharedObject< int > | m_exceptionCounter |
a counter More... | |
Tests the WThreadedFunction class.
Definition at line 41 of file WThreadedFunction_test.h.
|
inlineprivate |
Exception callback.
Definition at line 262 of file WThreadedFunction_test.h.
References WSharedObject< T >::getWriteTicket(), and m_exceptionCounter.
Referenced by testExceptionHandling().
|
inline |
Exceptions should lead to the status beeing changed to W_THREADS_ABORTED.
Also, exceptions should be forwarded to the exception handler.
Definition at line 243 of file WThreadedFunction_test.h.
References WSharedObject< T >::getReadTicket(), WSharedObject< T >::getWriteTicket(), handleException(), m_exceptionCounter, WThreadedFunction< Function_T >::run(), WThreadedFunctionBase::status(), WThreadedFunctionBase::subscribeExceptionSignal(), and WThreadedFunction< Function_T >::wait().
|
inline |
A function computed by multiple threads should correctly set its status and compute the correct results.
Definition at line 144 of file WThreadedFunction_test.h.
References WThreadedFunction< Function_T >::run(), WThreadedFunctionBase::status(), and WThreadedFunction< Function_T >::wait().
|
inline |
The stop condition should be notified correctly.
Definition at line 224 of file WThreadedFunction_test.h.
References WThreadedFunctionBase::getThreadsDoneCondition(), WThreadedFunction< Function_T >::run(), and WThreadedFunctionBase::status().
|
inline |
Status should be set correctly when threads are ordered to stop.
Definition at line 204 of file WThreadedFunction_test.h.
References WThreadedFunction< Function_T >::run(), WThreadedFunctionBase::status(), WThreadedFunction< Function_T >::stop(), and WThreadedFunction< Function_T >::wait().
|
private |
a counter
Definition at line 268 of file WThreadedFunction_test.h.
Referenced by handleException(), and testExceptionHandling().