CppUnit project page FAQ

Public Member Functions | Protected Attributes | Private Member Functions | List of all members
TestFailure Class Reference

Record of a failed Test execution.A TestFailure collects a failed test together with the caught exception. More...

#include <TestFailure.h>

Collaboration diagram for TestFailure:
Collaboration graph
[legend]

Public Member Functions

 TestFailure (Test *failedTest, Exception *thrownException, bool isError)
 Constructs a TestFailure with the given test and exception. More...
 
virtual ~TestFailure ()
 Deletes the owned exception. More...
 
virtual Test * failedTest () const
 Gets the failed test. More...
 
virtual Exception * thrownException () const
 Gets the thrown exception. Never NULL. More...
 
virtual SourceLine sourceLine () const
 Gets the failure location. More...
 
virtual bool isError () const
 Indicates if the failure is a failed assertion or an error. More...
 
virtual std::string failedTestName () const
 Gets the name of the failed test. More...
 
virtual TestFailure * clone () const
 

Protected Attributes

Test * m_failedTest
 
Exception * m_thrownException
 
bool m_isError
 

Private Member Functions

 TestFailure (const TestFailure &other)
 
TestFailure & operator= (const TestFailure &other)
 

Detailed Description

Record of a failed Test execution.

A TestFailure collects a failed test together with the caught exception.

TestFailure assumes lifetime control for any exception passed to it.

Constructor & Destructor Documentation

§ TestFailure() [1/2]

CPPUNIT_NS_BEGIN TestFailure::TestFailure ( Test *  failedTest,
Exception *  thrownException,
bool  isError 
)

Constructs a TestFailure with the given test and exception.

§ ~TestFailure()

TestFailure::~TestFailure ( )
virtual

Deletes the owned exception.

§ TestFailure() [2/2]

TestFailure::TestFailure ( const TestFailure &  other)
private

Member Function Documentation

§ clone()

TestFailure * TestFailure::clone ( ) const
virtual

§ failedTest()

Test * TestFailure::failedTest ( ) const
virtual

Gets the failed test.

§ failedTestName()

std::string TestFailure::failedTestName ( ) const
virtual

Gets the name of the failed test.

§ isError()

bool TestFailure::isError ( ) const
virtual

Indicates if the failure is a failed assertion or an error.

§ operator=()

TestFailure& TestFailure::operator= ( const TestFailure &  other)
private

§ sourceLine()

SourceLine TestFailure::sourceLine ( ) const
virtual

Gets the failure location.

§ thrownException()

Exception * TestFailure::thrownException ( ) const
virtual

Gets the thrown exception. Never NULL.

Member Data Documentation

§ m_failedTest

Test* TestFailure::m_failedTest
protected

§ m_isError

bool TestFailure::m_isError
protected

§ m_thrownException

Exception* TestFailure::m_thrownException
protected

The documentation for this class was generated from the following files:

Send comments to:
CppUnit Developers