diff options
| author | Phil Nash | 2017-11-17 18:38:30 +0000 |
|---|---|---|
| committer | GitHub | 2017-11-17 18:38:30 +0000 |
| commit | c443afcca01dababeb9f2e59675c3b290c80a749 (patch) | |
| tree | 2c09857e6f4b4e5e78dcbccc6e9c96993d4c2711 /include/internal/catch_assertionhandler.cpp | |
| parent | 502da4b38d059fdaa49f6e58486ae512122ef313 (diff) | |
| parent | b9339333df07c6ff3c13e8df5a8335397397258b (diff) | |
| download | catch3-c443afcca01dababeb9f2e59675c3b290c80a749.tar.gz | |
Merge pull request #1104 from coombez/contrib
Performance improvement
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
| -rw-r--r-- | include/internal/catch_assertionhandler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp index 0eed7cd9..3465269f 100644 --- a/include/internal/catch_assertionhandler.cpp +++ b/include/internal/catch_assertionhandler.cpp @@ -72,6 +72,13 @@ namespace Catch { bool negated = isFalseTest( m_assertionInfo.resultDisposition ); 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 ); } void AssertionHandler::handle( ResultWas::OfType resultType ) { |