ForwardGatherer Class Reference

Forwards all results to another gatherer prefixing the test names with a common name. More...

#include <unittest_decls.h>

Inheritance diagram for ForwardGatherer:

BaseGatherer List of all members.

Public Member Functions

std::auto_ptr< BaseGathererclone ()
 Create something that acts like this gatherer and can be deleted.
 ForwardGatherer (BaseGatherer &g, const std::string &p)
 Constructor.
void succeed (const std::string &n)
 Success reporting method.
void fail (const std::string &n, const std::string &r)
 Failure reporting method.
void pending (int n)
 Tells the gatherer that there are more reports to come.
BaseGathererforwardto ()
 Returns the gatherer that actually receives the result.
const std::string & prefixed () const
 Returns what this gatherer prepends to the test name before forwarding the report.

Detailed Description

Forwards all results to another gatherer prefixing the test names with a common name.


Constructor & Destructor Documentation

ForwardGatherer::ForwardGatherer ( BaseGatherer g,
const std::string &  p 
) [inline]

Constructor.

Parameters:
g is the gatherer to forward reports to
p is the string to be prepended to test names


Member Function Documentation

std::auto_ptr< BaseGatherer > ForwardGatherer::clone (  )  [virtual]

Create something that acts like this gatherer and can be deleted.

Returns:
a deletable BaseGatherer

Implements BaseGatherer.

void ForwardGatherer::succeed ( const std::string &  n  )  [virtual]

Success reporting method.

Parameters:
n is the name of the test that succeeded

Implements BaseGatherer.

void ForwardGatherer::fail ( const std::string &  n,
const std::string &  r 
) [virtual]

Failure reporting method.

Parameters:
n is the name of the test that failed
r is a reason for why the test failed

Implements BaseGatherer.

void ForwardGatherer::pending ( int  n  )  [virtual]

Tells the gatherer that there are more reports to come.

Parameters:
n is the number of reports that are to arrive, may be negative.

Reimplemented from BaseGatherer.

BaseGatherer & ForwardGatherer::forwardto (  )  [virtual]

Returns the gatherer that actually receives the result.

This exists in order to avoid endless chains of ForwardGatherers.

Returns:
the gatherer that this gatherer forwards results to or this if this gatherer does not forward anything

Reimplemented from BaseGatherer.

const std::string & ForwardGatherer::prefixed (  )  const [virtual]

Returns what this gatherer prepends to the test name before forwarding the report.

Returns:
the prefix or an empty string if this gatherer does not forward anything

Reimplemented from BaseGatherer.


The documentation for this class was generated from the following files:
Generated on Sat Feb 7 01:26:51 2009 by  doxygen 1.5.1