class CorUnitTest A tester class
| | checkAssert () |
| | CorUnitTest ( const CorUnitTest& aRef ) |
| | CorUnitTest () |
| | expectAssert ( int aNumber ) |
| | failHandler ( const char* aFile, int aLineNumber, const char* aText ) |
| | getOstream () |
| | getTester () |
| | operator= ( const CorUnitTest& aRef ) |
| | print ( const char* aText ) |
| | printBanner ( CorBool aPrintOn ) |
| | printf ( const char* aFormat, ... ) |
| | successHandler ( const char* aFile, int aLineNumber, const char* aText ) |
| | testMessages ( CorBool aMessagesOn ) |
| | ~CorUnitTest () |
| | mNumExpected Purpose Abort the test |
A tester class
SYNOPSIS
#include <CorUnitTest.h>
CorUnitTest myObject;
DESCRIPTION
This class provides unit testing utility functions. The test program should
create an instance of this class and pass it to the unit test function.
Each class should have a friend function called
utest_<className>(CorUnitTest&), eg.
class SubClass {
private:
friend void utest_SubClass(CorUnitTest&);
};
The checker maintains an instance count to ensure that only one CorUnitTest
can exist at any time. This is because:
The CorUnitTest in the test file should be called 'cortest' as in:
void TestMyClass(CorUnitTest& cortest){ .... }
The CorUnitTest grabs the assertion handler and processes the assertions for the caller.
CAUTIONS
<optional>
EXAMPLES
<optional>
SEE ALSO
COR_ASSERT
COR_DEBUG
Preconditions Exceptions
Preconditions Exceptions
Preconditions Exceptions
Preconditions Returns Exceptions
Preconditions Returns Exceptions
CorUnitTest()
The default c'tor.
CorUnitTest( const CorUnitTest& aRef )
CorUnitTest& operator=( const CorUnitTest& aRef )
~CorUnitTest()
The d'tor.
void expectAssert( int aNumber )
void checkAssert()
Check that all expected assertions were fired.
void print( const char* aText )
void printf( const char* aFormat, ... )
void printBanner( CorBool aPrintOn )
void testMessages( CorBool aMessagesOn )
_IO_ostream_withassign& getOstream()
Query the stream to be used for C++ << type message output.
This function returns the current output stream.
static CorUnitTest* getTester()
Query the current CorUnitTest instance.
This function returns the current CorUnitTest instance or 0.
void failHandler( const char* aFile, int aLineNumber, const char* aText )
void successHandler( const char* aFile, int aLineNumber, const char* aText )
void assertHandler( const char* aFile, int aLineNumber, const char* aText )
void reportHandler( const char* aHeader, const char* aFile, int aLineNumber, const char* aText )
static void assertion( const char* aFile, int aLineNumber, const char* aText )
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de