summaryrefslogtreecommitdiff
path: root/src/cppunit/TestFailure.cpp
diff options
context:
space:
mode:
authorBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-28 17:23:32 +0000
committerBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-28 17:23:32 +0000
commit6d95c46d9dc342bea176c8fbcd101db8eba24bef (patch)
tree3a42ea08625f64972f520cbeda2da3c68bbe9692 /src/cppunit/TestFailure.cpp
parent7e4ccacdbcf2f78005447f16e49d339d2a70e9ca (diff)
downloadcppunit-6d95c46d9dc342bea176c8fbcd101db8eba24bef.tar.gz
Moved files in subdir cppunit to src/cppunit.
Diffstat (limited to 'src/cppunit/TestFailure.cpp')
-rw-r--r--src/cppunit/TestFailure.cpp26
1 files changed, 26 insertions, 0 deletions
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