CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

CppUnit::TestDecorator Class Reference

Decorator for Tests. More...

#include <TestDecorator.h>

Inheritance diagram for CppUnit::TestDecorator:

Inheritance graph
[legend]
Collaboration diagram for CppUnit::TestDecorator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TestDecorator (Test *test)
 ~TestDecorator ()
void run (TestResult *result)
 Run the test, collecting results.

int countTestCases () const
 Return the number of test cases invoked by run().

std::string getName () const
 Returns the test name.

std::string toString () const
 Description of the test, for diagnostic output.


Protected Attributes

Testm_test

Private Member Functions

 TestDecorator (const TestDecorator &)
void operator= (const TestDecorator &)

Detailed Description

Decorator for Tests.

TestDecorator 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.

Does not assume ownership of the test it decorates


Constructor & Destructor Documentation

CppUnit::TestDecorator::TestDecorator Test test  )  [inline]
 

CppUnit::TestDecorator::~TestDecorator  )  [inline]
 

CppUnit::TestDecorator::TestDecorator const TestDecorator  )  [private]
 


Member Function Documentation

int CppUnit::TestDecorator::countTestCases  )  const [inline, virtual]
 

Return the number of test cases invoked by run().

The base unit of testing is the class TestCase. This method returns the number of TestCase objects invoked by the run() method.

Implements CppUnit::Test.

Reimplemented in CppUnit::RepeatedTest.

std::string CppUnit::TestDecorator::getName  )  const [inline, 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 CppUnit::Test.

void CppUnit::TestDecorator::operator= const TestDecorator  )  [private]
 

void CppUnit::TestDecorator::run TestResult result  )  [inline, virtual]
 

Run the test, collecting results.

Implements CppUnit::Test.

Reimplemented in CppUnit::RepeatedTest, and CppUnit::TestSetUp.

std::string CppUnit::TestDecorator::toString  )  const [inline, virtual]
 

Description of the test, for diagnostic output.

The test description will typically include the test name, but may have additional description. For example, a test suite named complex_add may be described as suite complex_add.

Implements CppUnit::Test.

Reimplemented in CppUnit::RepeatedTest.


Member Data Documentation

Test* CppUnit::TestDecorator::m_test [protected]
 


The documentation for this class was generated from the following file:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers