OpenWalnut 1.2.5
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 255 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 245 of file WWorkerThread_test.h.

References m_stopped.

Referenced by testSingleThread(), and testStopThread().

void WWorkerThreadTest::testExceptions ( ) [inline]
void WWorkerThreadTest::testMultipleThreads ( ) [inline]

Test if multiple threads correctly compute the result.

Definition at line 179 of file WWorkerThread_test.h.

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

void WWorkerThreadTest::testNoFunction ( ) [inline]

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

Definition at line 204 of file WWorkerThread_test.h.

void WWorkerThreadTest::testSingleThread ( void  ) [inline]

Test if calculation with a single thread works.

Definition at line 141 of file WWorkerThread_test.h.

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

void WWorkerThreadTest::testStopThread ( ) [inline]
void WWorkerThreadTest::testThreadId ( ) [inline]

An invalid thread id should cause an exception.

Definition at line 213 of file WWorkerThread_test.h.


Member Data Documentation

the exception was handled?

Definition at line 267 of file WWorkerThread_test.h.

Referenced by handleException(), and testExceptions().

the thread was stopped?

Definition at line 264 of file WWorkerThread_test.h.

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


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends