![]() |
OpenWalnut
1.5.0dev
|
Tests the WWorkerThread class. More...
#include <WWorkerThread_test.h>
Inheritance diagram for WWorkerThreadTest:
Collaboration diagram for WWorkerThreadTest:Classes | |
| class | ExceptionalFuncType |
| A function that throws exceptions. More... | |
| class | FuncType |
| A threaded function. More... | |
Public Member Functions | |
| void | testSingleThread (void) |
| Test if calculation with a single thread works. More... | |
| void | testStopThread () |
| Test if the thread gets shutdown correctly. More... | |
| void | testMultipleThreads () |
| Test if multiple threads correctly compute the result. More... | |
| void | testNoFunction () |
| Providing a zero-Pointer as function should cause an exception. More... | |
| void | testThreadId () |
| An invalid thread id should cause an exception. More... | |
| void | testExceptions () |
| Test if exceptions get handled correctly. More... | |
Private Member Functions | |
| void | stopTestDone () |
| A utility function. More... | |
| void | handleException (WException const &e) |
| Another one. More... | |
Private Attributes | |
| bool | m_stopped |
| the thread was stopped? More... | |
| bool | m_exceptionHandled |
| the exception was handled? More... | |
Tests the WWorkerThread class.
Definition at line 39 of file WWorkerThread_test.h.
|
inlineprivate |
Another one.
| e | An exception. |
Definition at line 254 of file WWorkerThread_test.h.
References m_exceptionHandled, and WException::what().
Referenced by testExceptions().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
A utility function.
Definition at line 244 of file WWorkerThread_test.h.
References m_stopped.
Referenced by testSingleThread(), and testStopThread().
Here is the caller graph for this function:
|
inline |
Test if exceptions get handled correctly.
Definition at line 226 of file WWorkerThread_test.h.
References handleException(), m_exceptionHandled, WThreadedRunner::run(), WWorkerThread< Function_T >::subscribeExceptionSignal(), and WThreadedRunner::wait().
Here is the call graph for this function:
|
inline |
Test if multiple threads correctly compute the result.
Definition at line 178 of file WWorkerThread_test.h.
References WThreadedRunner::run(), and WThreadedRunner::wait().
Here is the call graph for this function:
|
inline |
Providing a zero-Pointer as function should cause an exception.
Definition at line 203 of file WWorkerThread_test.h.
|
inline |
Test if calculation with a single thread works.
Definition at line 140 of file WWorkerThread_test.h.
References m_stopped, WThreadedRunner::run(), stopTestDone(), WWorkerThread< Function_T >::subscribeStopSignal(), and WThreadedRunner::wait().
Here is the call graph for this function:
|
inline |
Test if the thread gets shutdown correctly.
Definition at line 159 of file WWorkerThread_test.h.
References m_stopped, WThreadedRunner::requestStop(), WThreadedRunner::run(), stopTestDone(), WWorkerThread< Function_T >::subscribeStopSignal(), and WThreadedRunner::wait().
Here is the call graph for this function:
|
inline |
An invalid thread id should cause an exception.
Definition at line 212 of file WWorkerThread_test.h.
|
private |
the exception was handled?
Definition at line 266 of file WWorkerThread_test.h.
Referenced by handleException(), and testExceptions().
|
private |
the thread was stopped?
Definition at line 263 of file WWorkerThread_test.h.
Referenced by stopTestDone(), testSingleThread(), and testStopThread().