CppUnit project page FAQ

Public Member Functions | Protected Attributes | Private Member Functions | List of all members
TestCaseDecorator Class Reference

Decorator for Test cases. More...

#include <TestCaseDecorator.h>

Inheritance diagram for TestCaseDecorator:
Inheritance graph
[legend]
Collaboration diagram for TestCaseDecorator:
Collaboration graph
[legend]

Public Member Functions

 TestCaseDecorator (TestCase *test)
 
 ~TestCaseDecorator ()
 
std::string getName () const
 Returns the test name. More...
 
void setUp ()
 Set up context before running a test. More...
 
void tearDown ()
 Clean up after the test run. More...
 
void runTest ()
 FIXME: this should probably be pure virtual. More...
 
- Public Member Functions inherited from TestCase
 TestCase (const std::string &name)
 Constructs a test case. More...
 
 TestCase ()
 Constructs a test case for a suite. More...
 
 ~TestCase ()
 Destructs a test case. More...
 
virtual void run (TestResult *result)
 Run the test and catch any exceptions that are triggered by it. More...
 
std::string getName () const
 Returns the name of the test case. More...
 
- Public Member Functions inherited from TestLeaf
int countTestCases () const
 
int getChildTestCount () const
 
TestdoGetChildTestAt (int index) const
 
- Public Member Functions inherited from Test
virtual ~Test ()
 
virtual TestgetChildTestAt (int index) const
 Returns the child test of the specified index. More...
 
virtual bool findTestPath (const std::string &testName, TestPath &testPath) const
 Finds the test with the specified name and its parents test. More...
 
virtual bool findTestPath (const Test *test, TestPath &testPath) const
 Finds the specified test and its parents test. More...
 
virtual TestfindTest (const std::string &testName) const
 Finds the test with the specified name in the hierarchy. More...
 
virtual TestPath resolveTestPath (const std::string &testPath) const
 Resolved the specified test path with this test acting as 'root'. More...
 
- Public Member Functions inherited from TestFixture
virtual ~TestFixture ()
 

Protected Attributes

TestCasem_test
 

Private Member Functions

 TestCaseDecorator (const TestCaseDecorator &)
 
TestCaseDecoratoroperator= (const TestCaseDecorator &)
 

Additional Inherited Members

- Protected Member Functions inherited from Test
virtual void checkIsValidIndex (int index) const
 

Detailed Description

Decorator for Test cases.

TestCaseDecorator provides an alternate means to extend functionality of a test class without subclassing the test. Instead, one can subclass the decorater and use it to wrap the test class.

Assumes ownership of the test it decorates

Constructor & Destructor Documentation

◆ TestCaseDecorator() [1/2]

CPPUNIT_NS_BEGIN TestCaseDecorator::TestCaseDecorator ( TestCase test)

◆ ~TestCaseDecorator()

TestCaseDecorator::~TestCaseDecorator ( )

◆ TestCaseDecorator() [2/2]

TestCaseDecorator::TestCaseDecorator ( const TestCaseDecorator )
private

Member Function Documentation

◆ getName()

std::string TestCaseDecorator::getName ( ) const
virtual

Returns the test name.

Each test has a name. This name may be used to find the test in a suite or registry of tests.

Implements Test.

◆ operator=()

TestCaseDecorator& TestCaseDecorator::operator= ( const TestCaseDecorator )
private

◆ runTest()

void TestCaseDecorator::runTest ( )
virtual

FIXME: this should probably be pure virtual.

All the work for runTest is deferred to subclasses.

Reimplemented from TestCase.

◆ setUp()

void TestCaseDecorator::setUp ( )
virtual

Set up context before running a test.

Reimplemented from TestFixture.

◆ tearDown()

void TestCaseDecorator::tearDown ( )
virtual

Clean up after the test run.

Reimplemented from TestFixture.

Member Data Documentation

◆ m_test

TestCase* TestCaseDecorator::m_test
protected

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

Send comments to:
CppUnit Developers