OpenWalnut
1.4.0
|
Test the WThreadedPerVoxelOperation template. More...
#include <WThreadedPerVoxelOperation_test.h>
Public Member Functions | |
void | setUp () |
Setup logger and other stuff for each test. | |
void | testInstantiation () |
Test if everything gets instantiated correctly or if incorrect values properly lead to exceptions. | |
void | testMultithreadedFunction () |
Now test the whole class as a multithreaded function. | |
Private Types | |
typedef WThreadedPerVoxelOperation < int, 2, float, 3 > | TPVO |
the test instance of the template | |
typedef TPVO::ValueSetType | ValueSetType |
the type of valueset used in the test | |
typedef TPVO::TransmitType | ArrayType |
the input type of the test function | |
typedef TPVO::OutTransmitType | OutArrayType |
the output type of the test function | |
Private Member Functions | |
OutArrayType const | func (ArrayType const &a) const |
The test operation. | |
boost::shared_ptr< WDataSetSingle > | buildTestData () |
Build a test dataset. | |
void | handleException (WException const &) |
Handle an exception. | |
void | handleThreadsDone () |
This function gets called when all threads are done. | |
Private Attributes | |
bool | m_exception |
a flag that is used to check if any exceptions were thrown | |
bool | m_threadsDone |
a flag indicating if all threads are done |
Test the WThreadedPerVoxelOperation template.
Definition at line 43 of file WThreadedPerVoxelOperation_test.h.
typedef TPVO::TransmitType WThreadedPerVoxelOperationTest::ArrayType [private] |
the input type of the test function
Definition at line 52 of file WThreadedPerVoxelOperation_test.h.
typedef TPVO::OutTransmitType WThreadedPerVoxelOperationTest::OutArrayType [private] |
the output type of the test function
Definition at line 55 of file WThreadedPerVoxelOperation_test.h.
typedef WThreadedPerVoxelOperation< int, 2, float, 3 > WThreadedPerVoxelOperationTest::TPVO [private] |
the test instance of the template
Definition at line 46 of file WThreadedPerVoxelOperation_test.h.
typedef TPVO::ValueSetType WThreadedPerVoxelOperationTest::ValueSetType [private] |
the type of valueset used in the test
Definition at line 49 of file WThreadedPerVoxelOperation_test.h.
boost::shared_ptr< WDataSetSingle > WThreadedPerVoxelOperationTest::buildTestData | ( | ) | [inline, private] |
Build a test dataset.
Definition at line 160 of file WThreadedPerVoxelOperation_test.h.
Referenced by testInstantiation(), and testMultithreadedFunction().
OutArrayType const WThreadedPerVoxelOperationTest::func | ( | ArrayType const & | a | ) | const [inline, private] |
The test operation.
a | The subarray of the input valueset that denotes the voxel's data. |
Definition at line 146 of file WThreadedPerVoxelOperation_test.h.
Referenced by testInstantiation(), testMultithreadedFunction(), and WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::WThreadedPerVoxelOperation().
void WThreadedPerVoxelOperationTest::handleException | ( | WException const & | ) | [inline, private] |
Handle an exception.
Definition at line 173 of file WThreadedPerVoxelOperation_test.h.
References m_exception.
Referenced by testMultithreadedFunction().
void WThreadedPerVoxelOperationTest::handleThreadsDone | ( | ) | [inline, private] |
This function gets called when all threads are done.
Definition at line 184 of file WThreadedPerVoxelOperation_test.h.
References m_threadsDone.
Referenced by testMultithreadedFunction().
void WThreadedPerVoxelOperationTest::setUp | ( | void | ) | [inline] |
Setup logger and other stuff for each test.
Definition at line 61 of file WThreadedPerVoxelOperation_test.h.
References WLogger::startup().
void WThreadedPerVoxelOperationTest::testInstantiation | ( | void | ) | [inline] |
Test if everything gets instantiated correctly or if incorrect values properly lead to exceptions.
Definition at line 70 of file WThreadedPerVoxelOperation_test.h.
References buildTestData(), func(), and WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::m_grid.
void WThreadedPerVoxelOperationTest::testMultithreadedFunction | ( | ) | [inline] |
Now test the whole class as a multithreaded function.
Definition at line 94 of file WThreadedPerVoxelOperation_test.h.
References buildTestData(), func(), WThreadedFunctionBase::getThreadsDoneCondition(), handleException(), handleThreadsDone(), m_exception, m_threadsDone, WThreadedFunction< Function_T >::run(), WThreadedFunctionBase::subscribeExceptionSignal(), and WThreadedFunction< Function_T >::wait().
bool WThreadedPerVoxelOperationTest::m_exception [private] |
a flag that is used to check if any exceptions were thrown
Definition at line 179 of file WThreadedPerVoxelOperation_test.h.
Referenced by handleException(), and testMultithreadedFunction().
bool WThreadedPerVoxelOperationTest::m_threadsDone [private] |
a flag indicating if all threads are done
Definition at line 190 of file WThreadedPerVoxelOperation_test.h.
Referenced by handleThreadsDone(), and testMultithreadedFunction().