Merge pull request #1104 from coombez/contrib

Performance improvement
This commit is contained in:
Phil Nash 2017-11-17 18:38:30 +00:00 committed by GitHub
commit c443afcca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,13 @@ namespace Catch {
bool negated = isFalseTest( m_assertionInfo.resultDisposition ); bool negated = isFalseTest( m_assertionInfo.resultDisposition );
bool result = expr.getResult() != negated; bool result = expr.getResult() != negated;
if(result && !getCurrentContext().getConfig()->includeSuccessfulResults())
{
getCurrentContext().getResultCapture()->assertionRun();
getCurrentContext().getResultCapture()->assertionPassed();
return;
}
handle( result ? ResultWas::Ok : ResultWas::ExpressionFailed, &expr, negated ); handle( result ? ResultWas::Ok : ResultWas::ExpressionFailed, &expr, negated );
} }
void AssertionHandler::handle( ResultWas::OfType resultType ) { void AssertionHandler::handle( ResultWas::OfType resultType ) {