OpenWalnut  1.5.0dev
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
WThreadedPerVoxelOperationTest Class Reference

Test the WThreadedPerVoxelOperation template. More...

#include <WThreadedPerVoxelOperation_test.h>

+ Inheritance diagram for WThreadedPerVoxelOperationTest:
+ Collaboration diagram for WThreadedPerVoxelOperationTest:

Public Member Functions

void setUp ()
 Setup logger and other stuff for each test. More...
 
void testInstantiation ()
 Test if everything gets instantiated correctly or if incorrect values properly lead to exceptions. More...
 
void testMultithreadedFunction ()
 Now test the whole class as a multithreaded function. More...
 

Private Types

typedef WThreadedPerVoxelOperation< int, 2, float, 3 > TPVO
 the test instance of the template More...
 
typedef TPVO::ValueSetType ValueSetType
 the type of valueset used in the test More...
 
typedef TPVO::TransmitType ArrayType
 the input type of the test function More...
 
typedef TPVO::OutTransmitType OutArrayType
 the output type of the test function More...
 

Private Member Functions

OutArrayType const func (ArrayType const &a) const
 The test operation. More...
 
std::shared_ptr< WDataSetSinglebuildTestData ()
 Build a test dataset. More...
 
void handleException (WException const &)
 Handle an exception. More...
 
void handleThreadsDone ()
 This function gets called when all threads are done. More...
 

Private Attributes

bool m_exception
 a flag that is used to check if any exceptions were thrown More...
 
bool m_threadsDone
 a flag indicating if all threads are done More...
 

Detailed Description

Test the WThreadedPerVoxelOperation template.

Definition at line 44 of file WThreadedPerVoxelOperation_test.h.

Member Typedef Documentation

◆ ArrayType

the input type of the test function

Definition at line 53 of file WThreadedPerVoxelOperation_test.h.

◆ OutArrayType

the output type of the test function

Definition at line 56 of file WThreadedPerVoxelOperation_test.h.

◆ TPVO

the test instance of the template

Definition at line 47 of file WThreadedPerVoxelOperation_test.h.

◆ ValueSetType

the type of valueset used in the test

Definition at line 50 of file WThreadedPerVoxelOperation_test.h.

Member Function Documentation

◆ buildTestData()

std::shared_ptr< WDataSetSingle > WThreadedPerVoxelOperationTest::buildTestData ( )
inlineprivate

Build a test dataset.

Returns
The test dataset.

Definition at line 161 of file WThreadedPerVoxelOperation_test.h.

Referenced by testInstantiation(), and testMultithreadedFunction().

+ Here is the caller graph for this function:

◆ func()

OutArrayType const WThreadedPerVoxelOperationTest::func ( ArrayType const &  a) const
inlineprivate

The test operation.

Parameters
aThe subarray of the input valueset that denotes the voxel's data.
Returns
The output data as an array.

Definition at line 147 of file WThreadedPerVoxelOperation_test.h.

Referenced by testInstantiation(), testMultithreadedFunction(), and WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::WThreadedPerVoxelOperation().

+ Here is the caller graph for this function:

◆ handleException()

void WThreadedPerVoxelOperationTest::handleException ( WException const &  )
inlineprivate

Handle an exception.

Definition at line 174 of file WThreadedPerVoxelOperation_test.h.

References m_exception.

Referenced by testMultithreadedFunction().

+ Here is the caller graph for this function:

◆ handleThreadsDone()

void WThreadedPerVoxelOperationTest::handleThreadsDone ( )
inlineprivate

This function gets called when all threads are done.

Definition at line 185 of file WThreadedPerVoxelOperation_test.h.

References m_threadsDone.

Referenced by testMultithreadedFunction().

+ Here is the caller graph for this function:

◆ setUp()

void WThreadedPerVoxelOperationTest::setUp ( )
inline

Setup logger and other stuff for each test.

Definition at line 62 of file WThreadedPerVoxelOperation_test.h.

References WLogger::startup().

+ Here is the call graph for this function:

◆ testInstantiation()

void WThreadedPerVoxelOperationTest::testInstantiation ( )
inline

Test if everything gets instantiated correctly or if incorrect values properly lead to exceptions.

Definition at line 71 of file WThreadedPerVoxelOperation_test.h.

References buildTestData(), func(), and WThreadedPerVoxelOperation< Value_T, numValues, Output_T, numOutputs >::m_grid.

+ Here is the call graph for this function:

◆ testMultithreadedFunction()

void WThreadedPerVoxelOperationTest::testMultithreadedFunction ( )
inline

Member Data Documentation

◆ m_exception

bool WThreadedPerVoxelOperationTest::m_exception
private

a flag that is used to check if any exceptions were thrown

Definition at line 180 of file WThreadedPerVoxelOperation_test.h.

Referenced by handleException(), and testMultithreadedFunction().

◆ m_threadsDone

bool WThreadedPerVoxelOperationTest::m_threadsDone
private

a flag indicating if all threads are done

Definition at line 191 of file WThreadedPerVoxelOperation_test.h.

Referenced by handleThreadsDone(), and testMultithreadedFunction().


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