Test failure should show condition, actual value, *and* expected (limit) value.
--- a/src/core/model/test.cc Fri Jan 10 17:20:26 2014 -0800
+++ b/src/core/model/test.cc Fri Jan 10 17:21:54 2014 -0800
@@ -73,6 +73,18 @@
std::string file;
int32_t line;
};
+std::ostream & operator << (std::ostream & os, const TestCaseFailure & failure)
+{
+ os << " test=\"" << failure.cond
+ << "\" actual=\"" << failure.actual
+ << "\" limit=\"" << failure.limit
+ << "\" in=\"" << failure.file
+ << ":" << failure.line
+ << "\" " << failure.message;
+
+ return os;
+}
+
struct TestCase::Result
{
Result ();
@@ -592,10 +604,7 @@
{
for (uint32_t i = 0; i < test->m_result->failure.size (); i++)
{
- TestCaseFailure failure = test->m_result->failure[i];
- *os << Indent (level) << " got=\"" << failure.cond << "\" expected=\""
- << failure.actual << "\" in=\"" << failure.file << ":" << failure.line
- << "\" " << failure.message << std::endl;
+ *os << Indent (level) << test->m_result->failure[i] << std::endl;
}
for (uint32_t i = 0; i < test->m_children.size (); i++)
{