Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_assertionhandler.cpp
diff options
context:
space:
mode:
authorNeal Coombes2017-11-15 14:43:43 -0600
committerNeal Coombes2017-11-15 14:43:43 -0600
commitb9339333df07c6ff3c13e8df5a8335397397258b (patch)
tree52f0c0a9b9082ed53b536342dafb120dad122fa5 /include/internal/catch_assertionhandler.cpp
parent61e29b56304286b0d86edd502eb8b547645b2c22 (diff)
downloadcatch3-b9339333df07c6ff3c13e8df5a8335397397258b.tar.gz
Performance improvement
Begin to address #1086 Brings test from 2m51.072s to 1m15.661s
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
-rw-r--r--include/internal/catch_assertionhandler.cpp7
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 ) {