OpenWalnut  1.4.0
Classes | Public Member Functions | Private Member Functions | Private Attributes
WWorkerThreadTest Class Reference

Tests the WWorkerThread class. More...

#include <WWorkerThread_test.h>

+ Inheritance diagram for WWorkerThreadTest:

List of all members.

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.
void testStopThread ()
 Test if the thread gets shutdown correctly.
void testMultipleThreads ()
 Test if multiple threads correctly compute the result.
void testNoFunction ()
 Providing a zero-Pointer as function should cause an exception.
void testThreadId ()
 An invalid thread id should cause an exception.
void testExceptions ()
 Test if exceptions get handled correctly.

Private Member Functions

void stopTestDone ()
 A utility function.
void handleException (WException const &e)
 Another one.

Private Attributes

bool m_stopped
 the thread was stopped?
bool m_exceptionHandled
 the exception was handled?

Detailed Description

Tests the WWorkerThread class.

Definition at line 38 of file WWorkerThread_test.h.


Member Function Documentation

void WWorkerThreadTest::handleException ( WException const &  e) [inline, private]

Another one.

Parameters:
eAn exception.

Definition at line 253 of file WWorkerThread_test.h.

References m_exceptionHandled, and WException::what().

Referenced by testExceptions().

void WWorkerThreadTest::stopTestDone ( ) [inline, private]

A utility function.

Definition at line 243 of file WWorkerThread_test.h.

References m_stopped.

Referenced by testSingleThread(), and testStopThread().

Test if multiple threads correctly compute the result.

Definition at line 177 of file WWorkerThread_test.h.

References WThreadedRunner::run(), and WThreadedRunner::wait().

Providing a zero-Pointer as function should cause an exception.

Definition at line 202 of file WWorkerThread_test.h.

void WWorkerThreadTest::testSingleThread ( void  ) [inline]

Test if calculation with a single thread works.

Definition at line 139 of file WWorkerThread_test.h.

References m_stopped, WThreadedRunner::run(), stopTestDone(), WWorkerThread< Function_T >::subscribeStopSignal(), and WThreadedRunner::wait().

An invalid thread id should cause an exception.

Definition at line 211 of file WWorkerThread_test.h.


Member Data Documentation

the exception was handled?

Definition at line 265 of file WWorkerThread_test.h.

Referenced by handleException(), and testExceptions().

the thread was stopped?

Definition at line 262 of file WWorkerThread_test.h.

Referenced by stopTestDone(), testSingleThread(), and testStopThread().


The documentation for this class was generated from the following file: