1
#include <cppunit/Exception.h>
2
#include <cppunit/Test.h>
3
#include <cppunit/TestFailure.h>
8
/// Constructs a TestFailure with the given test and exception.
9
TestFailure::TestFailure( Test *failedTest,
10
Exception *thrownException,
12
m_failedTest( failedTest ),
13
m_thrownException( thrownException ),
18
/// Deletes the owned exception.
19
TestFailure::~TestFailure()
21
delete m_thrownException;
24
/// Gets the failed test.
26
TestFailure::failedTest() const
32
/// Gets the thrown exception. Never \c NULL.
34
TestFailure::thrownException() const
36
return m_thrownException;
40
/// Gets the failure location.
42
TestFailure::sourceLine() const
44
return m_thrownException->sourceLine();
48
/// Indicates if the failure is a failed assertion or an error.
50
TestFailure::isError() const
56
/// Gets the name of the failed test.
58
TestFailure::failedTestName() const
60
return m_failedTest->getName();
65
TestFailure::clone() const
67
return new TestFailure( m_failedTest, m_thrownException->clone(), m_isError );