mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-29 07:59:25 +00:00
Fixed #132
This commit is contained in:
parent
2f92db9898
commit
134e45b3ad
4 changed files with 39 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Generated: 2012-10-28 12:06:53.944416
|
||||
* Generated: 2012-10-28 20:56:33.944771
|
||||
* ----------------------------------------------------------
|
||||
* This file has been merged from multiple headers. Please don't edit it directly
|
||||
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
||||
|
@ -943,13 +943,7 @@ private:
|
|||
|
||||
namespace Catch {
|
||||
|
||||
struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
|
||||
|
||||
template<typename T>
|
||||
inline void setResultIfBoolean( ExpressionResultBuilder&, const T& ) {}
|
||||
inline void setResultIfBoolean( ExpressionResultBuilder& result, bool value ) {
|
||||
result.setResultType( value );
|
||||
}
|
||||
struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
|
||||
|
||||
// Wraps the LHS of an expression and captures the operator and RHS (if any) - wrapping them all
|
||||
// in an ExpressionResultBuilder object
|
||||
|
@ -958,9 +952,7 @@ class ExpressionLhs {
|
|||
void operator = ( const ExpressionLhs& );
|
||||
|
||||
public:
|
||||
ExpressionLhs( T lhs ) : m_lhs( lhs ) {
|
||||
setResultIfBoolean( m_result.setLhs( Catch::toString( lhs ) ), lhs );
|
||||
}
|
||||
ExpressionLhs( T lhs ) : m_lhs( lhs ) {}
|
||||
|
||||
template<typename RhsT>
|
||||
ExpressionResultBuilder& operator == ( const RhsT& rhs ) {
|
||||
|
@ -1001,7 +993,11 @@ public:
|
|||
}
|
||||
|
||||
ExpressionResultBuilder& negate( bool shouldNegate ) {
|
||||
return m_result.negate( shouldNegate );
|
||||
bool value = m_lhs ? true : false;
|
||||
return m_result
|
||||
.setLhs( Catch::toString( value ) )
|
||||
.setResultType( value )
|
||||
.negate( shouldNegate );
|
||||
}
|
||||
|
||||
// Only simple binary expressions are allowed on the LHS.
|
||||
|
@ -1016,6 +1012,7 @@ private:
|
|||
ExpressionResultBuilder& captureExpression( const RhsT& rhs ) {
|
||||
return m_result
|
||||
.setResultType( Internal::compare<Op>( m_lhs, rhs ) )
|
||||
.setLhs( Catch::toString( m_lhs ) )
|
||||
.setRhs( Catch::toString( rhs ) )
|
||||
.setOp( Internal::OperatorTraits<Op>::getName() );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue