DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
OFTestManager Class Reference

The test manager singleton manages the list of available test cases and executes them. More...

List of all members.

Public Member Functions

OFTestTestcurrentTest ()
void addTest (OFTestTest *test)
 Register a test with this test manager.
int runTests (const OFList< OFTestTest * > &tests, const char *module)
 Run a list of test cases.
int run (int argc, char *argv[], const char *module)
 Handle the given arguments and run the requested test case.

Static Public Member Functions

static OFTestManagerinstance ()

Private Member Functions

 OFTestManager ()
 Private constructor, this is a singleton!
 OFTestManager (const OFTestManager &obj)
 Private undefined copy constructor.
OFTestManageroperator= (const OFTestManager &obj)
 Private undefined assignment operator.
OFBool buildTestsToRun (OFCommandLine &cmd, OFList< OFTestTest * > &tests)
 Build a list of tests which should be executed from the command line.
OFBool testMatches (const OFTestTest *test, const OFString &str)
 Test if the test name matches the given name.

Private Attributes

OFList< OFTestTest * > tests_
 List of tests. Statically allocated, so don't have to be freed.
OFTestTestcurTest_
 Currently running test.

Detailed Description

The test manager singleton manages the list of available test cases and executes them.


Member Function Documentation

void OFTestManager::addTest ( OFTestTest test) [inline]

Register a test with this test manager.

Parameters:
testthe test to register
OFBool OFTestManager::buildTestsToRun ( OFCommandLine cmd,
OFList< OFTestTest * > &  tests 
) [inline, private]

Build a list of tests which should be executed from the command line.

Parameters:
cmdcommand line arguments which should be parsed
testswill be set to the list of tests to run
Returns:
OFFalse if the command line could not be handled.
Returns:
the currently running test case
static OFTestManager& OFTestManager::instance ( ) [inline, static]
Returns:
the only instance of the test manager
int OFTestManager::run ( int  argc,
char *  argv[],
const char *  module 
) [inline]

Handle the given arguments and run the requested test case.

This function should be used for implementing main().

Parameters:
argcnumber of arguments
argvlist of arguments
modulename of the module that we are testing for
Returns:
0 in case of success, else an error value.
int OFTestManager::runTests ( const OFList< OFTestTest * > &  tests,
const char *  module 
) [inline]

Run a list of test cases.

The results will be printed on the console.

Parameters:
teststests to execute
OFBool OFTestManager::testMatches ( const OFTestTest test,
const OFString str 
) [inline, private]

Test if the test name matches the given name.

This function supports '?' and '*' for wildcards. However, '*' can only be used at the end of string.

Parameters:
testtest to check against
strthe string describing the tests
Returns:
OFTrue if we found a match, else OFFalse

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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027