CppUnit project page | FAQ | CppUnit home page |
A single test object. More...
#include <TestCase.h>
Public Member Functions | |
TestCase (const std::string &name) | |
Constructs a test case. | |
TestCase () | |
Constructs a test case for a suite. | |
~TestCase () | |
Destructs a test case. | |
virtual void | run (TestResult *result) |
Run the test and catch any exceptions that are triggered by it. | |
std::string | getName () const |
Returns the name of the test case. | |
virtual void | runTest () |
FIXME: this should probably be pure virtual. | |
Private Member Functions | |
TestCase (const TestCase &other) | |
TestCase & | operator= (const TestCase &other) |
Private Attributes | |
const std::string | m_name |
A single test object.
This class is used to implement a simple test case: define a subclass that overrides the runTest method.
You don't usually need to use that class, but TestFixture and TestCaller instead.
You are expected to subclass TestCase is you need to write a class similiar to TestCaller.
TestCase::TestCase | ( | const std::string & | name | ) |
Constructs a test case.
name | the name of the TestCase. |
TestCase::TestCase | ( | ) |
Constructs a test case for a suite.
TestCase::~TestCase | ( | ) |
Destructs a test case.
TestCase::TestCase | ( | const TestCase & | other | ) | [private] |
std::string TestCase::getName | ( | ) | const [virtual] |
void TestCase::run | ( | TestResult * | result | ) | [virtual] |
Run the test and catch any exceptions that are triggered by it.
Implements Test.
void TestCase::runTest | ( | ) | [virtual] |
FIXME: this should probably be pure virtual.
All the work for runTest is deferred to subclasses.
Reimplemented in ExceptionTestCaseDecorator< ExpectedException >, Orthodox< ClassUnderTest >, TestCaseDecorator, and TestCaller< Fixture >.
const std::string TestCase::m_name [private] |
|
hosts this site. |
Send comments to: CppUnit Developers |