From 62b5838fc18def592372da9c7d58bce014bb5c95 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 8 Sep 2011 07:18:31 +0000 Subject: [PATCH] lolunit: reverse the expected/actual logic. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CPPUNIT_ASSERT_EQUAL(a, b) “expects” the value “a” and fails if “b” is different. The logic seems backwards to me, but matching CppUnit’s output is important so I’m doing the same in LolUnit. --- src/lol/unit.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lol/unit.h b/src/lol/unit.h index 51e227a5..91d4b5a2 100644 --- a/src/lol/unit.h +++ b/src/lol/unit.h @@ -226,8 +226,8 @@ public: << " (F) line: " << __LINE__ << " " \ << __FILE__ << std::endl; \ m_errorlog << "equality assertion failed" << std::endl; \ - m_errorlog << "- Expected: " << (b) << std::endl; \ - m_errorlog << "- Actual : " << (a) << std::endl; \ + m_errorlog << "- Expected: " << (a) << std::endl; \ + m_errorlog << "- Actual : " << (b) << std::endl; \ m_errorlog << message; \ m_failure = true; \ return; \ @@ -245,8 +245,8 @@ public: << " (F) line: " << __LINE__ << " " \ << __FILE__ << std::endl; \ m_errorlog << "double equality assertion failed" << std::endl; \ - m_errorlog << "- Expected: " << (b) << std::endl; \ - m_errorlog << "- Actual : " << (a) << std::endl; \ + m_errorlog << "- Expected: " << (a) << std::endl; \ + m_errorlog << "- Actual : " << (b) << std::endl; \ m_errorlog << "- Delta : " << (t) << std::endl; \ m_errorlog << message; \ m_failure = true; \