The class TestSucessListener (see Figure C-30) is a subclass of TestListener and SynchronizedObject . It indicates whether the Test it observes has succeeded. If the TestResult includes a failure, the Test is not successful.

TestSucessListener belongs to the namespace CppUnit . It is declared in the file TestSucessListener.h and implemented in the file TestSucessListener.cpp .

Figure C-30. The class TestSucessListener


 class TestSucessListener : public TestListener, public SynchronizedObject 


TestSucessListener(SynchronizationObject *syncObject = 0)

A constructor. If syncObject is null , a new SynchronizationObject is created.

virtual ~TestSucessListener( )

A destructor.

Public Methods

void addFailure(const TestFailure &failure)

A method to report a TestFailure to the TestSucessListener . Sets m_sucess to FALSE .

virtual void reset( )

Resets m_sucess to TRUE .

virtual bool wasSuccessful( ) const

Returns value of m_sucess .

Protected/Private Methods



bool m_sucess

A test success indicator; TRUE unless there is a failure ( private ).

Unit Test Frameworks
Unit Test Frameworks
ISBN: 0596006896
EAN: 2147483647
Year: 2006
Pages: 146
Authors: Paul Hamill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net