streamlined acceptResult

This commit is contained in:
Phil Nash 2012-10-18 22:59:16 +01:00
parent 3ad13256e1
commit e3b111a39a
3 changed files with 2 additions and 12 deletions

View File

@ -155,7 +155,7 @@ inline bool isTrue( bool value ){ return value; }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \ #define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \
Catch::getResultCapture().acceptExpression( Catch::AssertionResultBuilder().setResultType( resultType ) << reason ); INTERNAL_CATCH_ACCEPT_EXPR( Catch::AssertionResultBuilder().setResultType( resultType ) << reason, stopOnFailure, true );
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_SCOPED_INFO( log ) \ #define INTERNAL_CATCH_SCOPED_INFO( log ) \

View File

@ -36,8 +36,6 @@ namespace Catch {
virtual bool shouldDebugBreak() const = 0; virtual bool shouldDebugBreak() const = 0;
virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0; virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) = 0;
virtual ResultAction::Value acceptResult( bool result ) = 0;
virtual ResultAction::Value acceptResult( ResultWas::OfType result ) = 0;
virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 0; virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) = 0;
virtual std::string getCurrentTestName() const = 0; virtual std::string getCurrentTestName() const = 0;

View File

@ -134,14 +134,6 @@ namespace Catch {
virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) { virtual void acceptAssertionInfo( const AssertionInfo& assertionInfo ) {
m_assertionInfo = assertionInfo; m_assertionInfo = assertionInfo;
} }
virtual ResultAction::Value acceptResult( bool result ) {
return acceptResult( result ? ResultWas::Ok : ResultWas::ExpressionFailed );
}
virtual ResultAction::Value acceptResult( ResultWas::OfType result ) {
m_currentResult.setResultType( result );
return actOnCurrentResult();
}
virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) { virtual ResultAction::Value acceptExpression( const AssertionResultBuilder& assertionResult ) {
m_currentResult = assertionResult; m_currentResult = assertionResult;