|
|
Log In | Not a Member? |
Contact ADC |
|
ADC Home > Reference Library > Reference > Tools > Xcode > CPlusTest Reference
|
Test |
| Declared In: |
Abstract base class for unit tests.
Test is an abstract base class that defines a common interface for unit tests, both individual test cases and test suites. A test has a name and can be run against a TestRun, which is used to record the results of the test. Immediately before it is run a test will have a fixture set up (via setUp) and immediately after it is done running this fixture will be torn down (via tearDown).
name |
Gets the name of the test.
public
virtual const std::string& name() = 0;
Returns the name of the test.
Gets the name of the test. For test cases this is generally in standard C++ "class::method" format, while for test suites this is generally the name of the test suite class.
run |
Runs the test, recording the results.
public
virtual void run( TestRun& run) = 0;
runRuns the test and record the success or any failure information in the passed TestRun. This will invoke the test's setUp and tearDown methods around the actual invocation of the test.
setUp |
Sets up any necessary state before a test is run.
public
virtual void setUp() = 0;
Sets up any state needed by a test immediately before it is run. State used by a test should be set up here rather than in the test constructor so that it is only present when necessary.
tearDown |
Tears down any state previously set up in setUp after a test has run.
public
virtual void tearDown() = 0;
Tears down any state needed by a test immediately after it has run. State used by a test should be torn down here rather than in the test destructor so that it is only present as long as necessary.
Test |
Plain constructor for the Test class.
public
Test();
Plain constructor for the Test class. Does nothing, since Test is an abstract base class.
~Test |
Destructor for the Test class.
public
virtual ~Test();
Destructor for the Test class. Does nothing, since Test is an abstract base class.
|