diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 1285b31f..07645c48 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -33,7 +33,7 @@ do { \ Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ try { \ - ( __catchResult->*expr ).endExpression(); \ + ( __catchResult <= expr ).endExpression(); \ } \ catch( ... ) { \ __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \ diff --git a/include/internal/catch_result_builder.h b/include/internal/catch_result_builder.h index 3963c26d..d5db994f 100644 --- a/include/internal/catch_result_builder.h +++ b/include/internal/catch_result_builder.h @@ -41,8 +41,8 @@ namespace Catch { ResultDisposition::Flags resultDisposition ); template - ExpressionLhs operator->* ( T const& operand ); - ExpressionLhs operator->* ( bool value ); + ExpressionLhs operator<= ( T const& operand ); + ExpressionLhs operator<= ( bool value ); template ResultBuilder& operator << ( T const& value ) { @@ -93,11 +93,11 @@ namespace Catch { namespace Catch { template - inline ExpressionLhs ResultBuilder::operator->* ( T const& operand ) { + inline ExpressionLhs ResultBuilder::operator<= ( T const& operand ) { return ExpressionLhs( *this, operand ); } - inline ExpressionLhs ResultBuilder::operator->* ( bool value ) { + inline ExpressionLhs ResultBuilder::operator<= ( bool value ) { return ExpressionLhs( *this, value ); } diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index a1676570..096a26c6 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -55,18 +55,18 @@ TEST_CASE /////////////////////////////////////////////////////////////////////////////// TEST_CASE ( - "Where the LHS is not a simple value[failing]", - "[Tricky][failing][.]" + "Where the LHS is not a simple value", + "[Tricky]" ) { - /* int a = 1; int b = 2; - // This only captures part of the expression, but issues a warning about the rest - REQUIRE( a+1 == b-1 ); - */ - WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" ); + REQUIRE( a+1 == b ); + REQUIRE( a < b ); + + REQUIRE( a%2 == 1 ); + REQUIRE( b%2 == 0 ); } struct Opaque