summaryrefslogtreecommitdiff
path: root/src/cppunit/TextTestResult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cppunit/TextTestResult.cpp')
-rw-r--r--src/cppunit/TextTestResult.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/cppunit/TextTestResult.cpp b/src/cppunit/TextTestResult.cpp
index cbd226f..115da91 100644
--- a/src/cppunit/TextTestResult.cpp
+++ b/src/cppunit/TextTestResult.cpp
@@ -1,6 +1,7 @@
#include <iostream>
#include "cppunit/TextTestResult.h"
#include "cppunit/Exception.h"
+#include "cppunit/NotEqualException.h"
#include "cppunit/Test.h"
#include "estring.h"
@@ -82,9 +83,21 @@ TextTestResult::printFailures (std::ostream& stream)
<< ") "
<< "test: " << failure->failedTest()->getName() << " "
<< "line: " << (e ? estring (e->lineNumber ()) : "") << " "
- << (e ? e->fileName () : "") << " "
- << "\"" << failure->thrownException ()->what () << "\""
- << std::endl;
+ << (e ? e->fileName () : "") << " ";
+
+ if ( failure->thrownException()->isInstanceOf( NotEqualException::type() ) )
+ {
+ NotEqualException *e = (NotEqualException*)failure->thrownException();
+ stream << std::endl
+ << "expected: " << e->expectedValue() << std::endl
+ << "but was: " << e->actualValue();
+ }
+ else
+ {
+ stream << "\"" << failure->thrownException ()->what () << "\"";
+ }
+
+ stream << std::endl;
i++;
}
}