XUnitTest Class Reference

#include <test.h>

Inheritance diagram for XUnitTest:

XUnitTestSetup

List of all members.

Public Member Functions

 XUnitTest (const char *aName)
virtual ~XUnitTest ()
const char * getName () const
virtual void doTest ()=0

Static Public Member Functions

static void setResult (XUnitTestResult *apResult)
static XUnitTestResultresult ()
static void run (const char *aTestName="")
static void doOptions (int argc, char **argv)


Detailed Description

Basic test class. All tests are derived from this class.

Constructor & Destructor Documentation

XUnitTest::XUnitTest ( const char *  aName  ) 

Constructor. Saves the name of the test.

Parameters:
aName NUL terminated string containing the test name.

virtual XUnitTest::~XUnitTest (  )  [virtual]

Virtual destructor.


Member Function Documentation

static void XUnitTest::doOptions ( int  argc,
char **  argv 
) [static]

Static method to take the parameters from main() and run the tests accordingly. It needn't be used, but if it is then it saves a lot of option-handling code. For instance, the following code can by used for main():

 int main(int argc, char **argv)
 {
     XUnitTest::doOptions(argc, argv);
     return 0;
 }
Parameters:
argc number of parameters, including initial program name.
argv array of pointers to arguments. First string is used as program name in help text.

virtual void XUnitTest::doTest (  )  [pure virtual]

Virtual method for the test itself. The actual test class implements this function to do the testing.

const char* XUnitTest::getName (  )  const

Get the name of the test.

Returns:
NUL-terminated string containing the test name.

static XUnitTestResult* XUnitTest::result (  )  [static]

Static method to retrieve a pointer to the test result object. If this has not been set by the time this method is called then it will be set as the default base result class.

Returns:
pointer to the currently set result object.

static void XUnitTest::run ( const char *  aTestName = ""  )  [static]

Static method to run the tests. The optional argument specifies a test name prefix, only tests with names matching that prefix will be run.

Parameters:
aTestName test name prefix, or NULL to run all tests.

static void XUnitTest::setResult ( XUnitTestResult apResult  )  [static]

Static method to set the result class object. If it is not set by the time the test is run, the default base result class will be used.

Parameters:
apResult Pointer to the result test class object.


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

Generated on Sat Oct 18 11:15:36 2008 for XUnitTest by  doxygen 1.5.7.1