From 6d95c46d9dc342bea176c8fbcd101db8eba24bef Mon Sep 17 00:00:00 2001 From: Bastiaan Bakker Date: Sat, 28 Apr 2001 17:23:32 +0000 Subject: Moved files in subdir cppunit to src/cppunit. --- src/cppunit/TestFailure.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/cppunit/TestFailure.cpp (limited to 'src/cppunit/TestFailure.cpp') diff --git a/src/cppunit/TestFailure.cpp b/src/cppunit/TestFailure.cpp new file mode 100644 index 0000000..6a48696 --- /dev/null +++ b/src/cppunit/TestFailure.cpp @@ -0,0 +1,26 @@ +#include "cppunit/TestFailure.h" +#include "cppunit/Exception.h" +#include "cppunit/Test.h" + +namespace CppUnit { + +/// Returns a short description of the failure. +std::string +TestFailure::toString () const +{ + return m_failedTest->toString () + ": " + m_thrownException->what (); +} + +/// Constructs a TestFailure with the given test and exception. +TestFailure::TestFailure (Test *failedTest, Exception *thrownException) + : m_failedTest (failedTest), m_thrownException (thrownException) +{ +} + +/// Deletes the owned exception. +TestFailure::~TestFailure () +{ + delete m_thrownException; +} + +} // namespace CppUnit -- cgit v1.2.1