CppUnit project page | FAQ | CppUnit home page |
#include <TestPath.h>
Public Member Functions | ||||
TestPath () | ||||
Constructs an invalid path. | ||||
TestPath (Test *root) | ||||
Constructs a valid path. | ||||
TestPath (const TestPath &otherPath, int indexFirst, int count=-1) | ||||
Constructs a path using a slice of another path. | ||||
TestPath (Test *searchRoot, const std::string &pathAsString) | ||||
Resolves a path from a string returned by toString(). | ||||
TestPath (const TestPath &other) | ||||
Copy constructor. | ||||
virtual | ~TestPath () | |||
virtual bool | isValid () const | |||
Tests if the path contains at least one test. | ||||
virtual void | add (Test *test) | |||
Adds a test to the path. | ||||
virtual void | add (const TestPath &path) | |||
Adds all the tests of the specified path. | ||||
virtual void | insert (Test *test, int index) | |||
Inserts a test at the specified index. | ||||
virtual void | insert (const TestPath &path, int index) | |||
Inserts all the tests at the specified path at a given index. | ||||
virtual void | removeTests () | |||
Removes all the test from the path. | ||||
virtual void | removeTest (int index) | |||
Removes the test at the specified index of the path. | ||||
virtual void | up () | |||
Removes the last test.
| ||||
virtual int | getTestCount () const | |||
Returns the number of tests in the path. | ||||
virtual Test * | getTestAt (int index) const | |||
Returns the test of the specified index. | ||||
virtual Test * | getChildTest () const | |||
Get the last test of the path. | ||||
virtual std::string | toString () const | |||
Returns the path as a string. | ||||
TestPath & | operator= (const TestPath &other) | |||
Assignment operator. | ||||
Protected Types | ||||
typedef CppUnitDeque< std::string > | PathTestNames | |||
A list of test names. | ||||
typedef CppUnitDeque< Test * > | Tests | |||
Protected Member Functions | ||||
void | checkIndexValid (int index) const | |||
Checks that the specified test index is within valid range. | ||||
bool | splitPathString (const std::string &pathAsString, PathTestNames &testNames) | |||
Splits a path string into its test name components. | ||||
Test * | findActualRoot (Test *searchRoot, const std::string &pathAsString, PathTestNames &testNames) | |||
Finds the actual root of a path string and get the path string name components. | ||||
Protected Attributes | ||||
Tests | m_tests |
The path can be converted to a string and resolved from a string with toString() and TestPath( Test *root, const std::string &pathAsString ).
Pointed tests are not owned by the class.
|
A list of test names.
|
|
|
|
Constructs an invalid path. The path is invalid until a test is added with add(). |
|
Constructs a valid path.
|
|
Constructs a path using a slice of another path.
|
|
Resolves a path from a string returned by toString(). If pathAsString is an absolute path (begins with '/'), then the first test name of the path must be the name of searchRoot. Otherwise, pathAsString is a relative path, and the first test found using Test::findTest() matching the first test name is used as root. An empty string resolve to a path containing searchRoot. The resolved path is always valid.
|
|
Copy constructor.
|
|
|
|
Adds all the tests of the specified path.
|
|
Adds a test to the path.
|
|
Checks that the specified test index is within valid range.
|
|
Finds the actual root of a path string and get the path string name components.
|
|
Get the last test of the path.
|
|
Returns the test of the specified index.
|
|
Returns the number of tests in the path.
|
|
Inserts all the tests at the specified path at a given index.
|
|
Inserts a test at the specified index.
|
|
Tests if the path contains at least one test.
|
|
Assignment operator.
|
|
Removes the test at the specified index of the path.
|
|
Removes all the test from the path. The path becomes invalid after this call. |
|
Splits a path string into its test name components.
|
|
Returns the path as a string. For example, if a path is composed of three tests named "All Tests", "Math" and "Math::testAdd", toString() will return: "All Tests/Math/Math::testAdd".
|
|
Removes the last test.
|
|
|
|
hosts this site. |
Send comments to: CppUnit Developers |