The class TextOutputter (see Figure C-34) is a subclass of Outputter . It gets test results from a TestResultCollector and outputs them in text format to an output stream.

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

Figure C-34. The class TextOutputter


 class TextOutputter : public Outputter 


TextOutputter(TestResultCollector *result, ostream & stream)

Creates a TextOutputter to get test results from result and output them to stream .

virtual ~TextOutputter( )

A destructor.

Public Methods

virtual void printFailure(TestFailure *failure, int failureNumber)

virtual void printFailureDetail(Exception *thrownException)

virtual void printFailureListMark(int failureNumber)

virtual void printFailureLocation(SourceLine sourceLine)

virtual void printFailures( )

virtual void printFailureTestName(TestFailure *failure)

virtual void printFailureType(TestFailure *failure)

virtual void printFailureWarning( )

virtual void printHeader( )

virtual void printStatistics( )

Methods that print various portions of the test results to m_stream . Generally, the write() method is called instead of calling these methods directly.

void write( )

A method called to output results. Calls printHeader() and printFailures( ) .

Protected/Private Methods

TextOutputter(const TextOutputter& copy)

A copy constructor, scoped private to prevent its use.

void operator=(const TextOutputter& copy)

A copy operator, scoped private to prevent its use.


TestResultCollector *m_result

The TestResultCollector passed in the constructor. ( private )

ostream& m_stream

The output stream passed in the constructor. ( 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