CppUnit - The Unit Testing Library

CppUnit project page | FAQ

Public Member Functions | List of all members
TestLeaf Class Reference

A single test object. More...

`#include <TestLeaf.h>`

Inheritance diagram for TestLeaf:
[legend]
Collaboration diagram for TestLeaf:
[legend]

## Public Member Functions
int | countTestCases () const
int | getChildTestCount () const
Test * | doGetChildTestAt (int index) const
Public Member Functions inherited from Test
virtual | ~Test ()
virtual void | run (TestResult *result)=0
| Run the test, collecting results. More...
virtual int | countTestCases () const =0
| Return the number of test cases invoked by run(). More...
virtual int | getChildTestCount () const =0
| Returns the number of direct child of the test. More...
virtual Test * | getChildTestAt (int index) const
| Returns the child test of the specified index. More...
virtual std::string | getName () const =0
| Returns the test name. 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 Test * | findTest (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...

## Additional Inherited Members
Protected Member Functions inherited from Test
virtual void | checkIsValidIndex (int index) const
virtual Test * | doGetChildTestAt (int index) const =0
| Returns the child test of the specified valid index. More...

## Detailed Description

A single test object.

Base class for single test case: a test that doesn't have any children.

## Member Function Documentation

## ◆ countTestCases()

CPPUNIT_NS_BEGIN int TestLeaf::countTestCases | ( |  | ) | const
| virtual

Returns 1 as the default number of test cases invoked by run().

You may override this method when many test cases are invoked (RepeatedTest for example).

Returns
  1.

See also
  Test::countTestCases().

Implements Test.

## ◆ doGetChildTestAt()

Test * TestLeaf::doGetChildTestAt | ( | int | index | ) | const
| virtual

Always throws std::out_of_range.

See also
  Test::doGetChildTestAt().

Implements Test.

## ◆ getChildTestCount()

int TestLeaf::getChildTestCount | ( |  | ) | const
| virtual

Returns the number of child of this test case: 0.

You should never override this method: a TestLeaf as no children by definition.

Returns
  0.

Implements Test.

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

- TestLeaf.h
- TestLeaf.cpp

| Send comments to: CppUnit Developers