diff options
| author | Phil Nash | 2014-05-29 08:00:20 +0100 |
|---|---|---|
| committer | Phil Nash | 2014-05-29 08:00:20 +0100 |
| commit | be9fe7610148199ce3043668b4aa232795cb032d (patch) | |
| tree | 32deb1cf3eb84bc3f7b01b72bc700c23e418f3ef /include/internal | |
| parent | 10801c2876c4d37dc9636d905346f31785245540 (diff) | |
| download | catch3-be9fe7610148199ce3043668b4aa232795cb032d.tar.gz | |
Renamed ShouldNegate to FalseTest
Diffstat (limited to 'include/internal')
| -rw-r--r-- | include/internal/catch_assertionresult.hpp | 2 | ||||
| -rw-r--r-- | include/internal/catch_result_builder.hpp | 14 | ||||
| -rw-r--r-- | include/internal/catch_result_type.h | 10 |
3 files changed, 12 insertions, 14 deletions
diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index 392270d8..bd59de9a 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -55,7 +55,7 @@ namespace Catch { } std::string AssertionResult::getExpression() const { - if( shouldNegate( m_info.resultDisposition ) ) + if( isFalseTest( m_info.resultDisposition ) ) return "!" + m_info.capturedExpression; else return m_info.capturedExpression; diff --git a/include/internal/catch_result_builder.hpp b/include/internal/catch_result_builder.hpp index 8f6c1a59..64e8e9f4 100644 --- a/include/internal/catch_result_builder.hpp +++ b/include/internal/catch_result_builder.hpp @@ -18,10 +18,6 @@ namespace Catch { - inline bool isFalseTest( int flags ) { - return ( flags & ResultDisposition::NegateResult ) != 0; - } - ResultBuilder::ResultBuilder( char const* macroName, SourceLineInfo const& lineInfo, char const* capturedExpression, @@ -94,10 +90,12 @@ namespace Catch { AssertionResultData data = m_data; // Flip bool results if testFalse is set - if( m_exprComponents.testFalse && data.resultType == ResultWas::Ok ) - data.resultType = ResultWas::ExpressionFailed; - else if( m_exprComponents.testFalse && data.resultType == ResultWas::ExpressionFailed ) - data.resultType = ResultWas::Ok; + if( m_exprComponents.testFalse ) { + if( data.resultType == ResultWas::Ok ) + data.resultType = ResultWas::ExpressionFailed; + else if( data.resultType == ResultWas::ExpressionFailed ) + data.resultType = ResultWas::Ok; + } data.message = m_stream.oss.str(); data.reconstructedExpression = reconstructExpression(); diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index 751a7138..ce00ef03 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -39,11 +39,11 @@ namespace Catch { // ResultDisposition::Flags enum struct ResultDisposition { enum Flags { - Normal = 0x00, + Normal = 0x00, - ContinueOnFailure = 0x01, // Failures fail test, but execution continues - NegateResult = 0x02, // Prefix expressiom with ! - SuppressFail = 0x04 // Failures are reported but do not fail the test + ContinueOnFailure = 0x01, // Failures fail test, but execution continues + FalseTest = 0x02, // Prefix expression with ! + SuppressFail = 0x04 // Failures are reported but do not fail the test }; }; inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { @@ -51,7 +51,7 @@ namespace Catch { } inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } - inline bool shouldNegate( int flags ) { return ( flags & ResultDisposition::NegateResult ) != 0; } + inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } } // end namespace Catch |