The class TestResult (see Figure C-26) receives test results from Test objects. Test results can be categorized as successes, failures, and errors. Normally, when multiple Test classes are run, a single TestResult is passed to the run( ) method of each Test .
A TestResult informs its observers of test progress and results using the TestListener interface. The TestListener subclass TestResultCollector normally is used to store the results. TestResult doesn't store the results itself.
A TestResult is a SynchronizedObject . Its operations are mutex-protected and thread-safe, allowing Test and TestListener objects to run in separate threads.
TestResult belongs to the namespace CppUnit . It is declared in TestResult.h and implemented in TestResult.cpp .
class TestResult : protected SynchronizedObject
A constructor. If a SynchronizationObject is not provided, a new one is created.
A method that informs TestResult of a test error (an Exception not caused by a test assertion).
A method that informs TestResult of a test failure (an Exception caused by a test assertion).
Adds a TestListener to this TestResult .
A method that informs TestResult that test has ended.
Removes a TestListener from this TestResult .
Sets m_stop to FALSE to prepare for a new test run.
Returns the value of m_stop .
A method that informs TestResult that test is about to be run.
Sets m_stop to TRUE to stop the test run.
A protected method that adds a TestFailure and inform listeners.
A copy constructor declared private to prevent its use.
A copy operator declared private to prevent its use.
Defines the type TestListeners as a deque of TestListener objects ( protected ).
The test listeners ( protected ).
If TRUE , the test run should stop ( protected ).