From 0653f4880ba6353b0cf9444930e9101337b6fd4a Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 19 Sep 2011 18:17:51 +0100 Subject: [PATCH 1/2] Added tests for true == true etc --- projects/SelfTest/ConditionTests.cpp | 4 ++++ projects/SelfTest/TestMain.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/SelfTest/ConditionTests.cpp b/projects/SelfTest/ConditionTests.cpp index 91d9f627..e03b8d05 100644 --- a/projects/SelfTest/ConditionTests.cpp +++ b/projects/SelfTest/ConditionTests.cpp @@ -241,6 +241,8 @@ TEST_CASE( "./succeeding/conditions/not", { bool falseValue = false; + REQUIRE( false == false ); + REQUIRE( true == true ); REQUIRE( !false ); REQUIRE_FALSE( false ); @@ -256,6 +258,8 @@ TEST_CASE( "./failing/conditions/not", { bool trueValue = true; + CHECK( false != false ); + CHECK( true != true ); CHECK( !true ); CHECK_FALSE( true ); diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 8355c2f7..4bab286f 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -47,7 +47,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" "Number of 'succeeding' tests is fixed" ) { runner.runMatching( "./succeeding/*" ); - CHECK( runner.getSuccessCount() == 257 ); + CHECK( runner.getSuccessCount() == 259 ); CHECK( runner.getFailureCount() == 0 ); } @@ -56,7 +56,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" { runner.runMatching( "./failing/*" ); CHECK( runner.getSuccessCount() == 0 ); - CHECK( runner.getFailureCount() == 60 ); + CHECK( runner.getFailureCount() == 62 ); } } } From 08a1b51987d57be145de0ce828bc3b054e698706 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 19 Sep 2011 18:19:13 +0100 Subject: [PATCH 2/2] Hold values by value and references by reference --- include/internal/catch_capture.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index e049d7f5..51e9d999 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -367,7 +367,7 @@ public: Expression ( MutableResultInfo& result, - const T& lhs + T lhs ) : m_result( result ), m_lhs( lhs ) @@ -475,7 +475,7 @@ public: private: MutableResultInfo& m_result; - const T& m_lhs; + T m_lhs; }; template @@ -564,12 +564,12 @@ public: /////////////////////////////////////////////////////////////////////////// template - Expression operator->* + Expression operator->* ( const T & operand ) { - Expression expr( m_result, operand ); + Expression expr( m_result, operand ); return expr; }