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

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_assertionhandler.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-11-24 19:15:46 +0000
committerPhil Nash2017-11-26 21:28:43 +0000
commitdb44964e27cb9dc4e4ff115e0ba29c9038824bcc (patch)
tree5146bd5f5e1a1c315c3d338ccd3c535e041c7c3e /include/internal/catch_assertionhandler.cpp
parent2800adba2518da903dca9ca2766a54772eabb00c (diff)
downloadcatch3-db44964e27cb9dc4e4ff115e0ba29c9038824bcc.tar.gz
Refactored most handle() calls to more specific/ descriptive calls
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
-rw-r--r--include/internal/catch_assertionhandler.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp
index 34540e94..a5a2e2c1 100644
--- a/include/internal/catch_assertionhandler.cpp
+++ b/include/internal/catch_assertionhandler.cpp
@@ -68,7 +68,7 @@ namespace Catch {
}
}
- void AssertionHandler::handle( ITransientExpression const& expr ) {
+ void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
bool negated = isFalseTest( m_assertionInfo.resultDisposition );
bool result = expr.getResult() != negated;
@@ -132,10 +132,26 @@ namespace Catch {
m_completed = true;
}
- void AssertionHandler::useActiveException() {
+ void AssertionHandler::handleUnexpectedInflightException() {
handle( ResultWas::ThrewException, Catch::translateActiveException() );
}
+ void AssertionHandler::handleExceptionThrownAsExpected() {
+ handle( Catch::ResultWas::Ok );
+ }
+ void AssertionHandler::handleExceptionNotThrownAsExpected() {
+ handle( Catch::ResultWas::Ok );
+ }
+
+ void AssertionHandler::handleUnexpectedExceptionNotThrown() {
+ handle( Catch::ResultWas::DidntThrowException );
+ }
+
+ void AssertionHandler::handleThrowingCallSkipped() {
+ handle( Catch::ResultWas::Ok );
+ }
+
+
// This is the overload that takes a string and infers the Equals matcher from it
// The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) {