Refactored most handle() calls to more specific/ descriptive calls

This commit is contained in:
Phil Nash 2017-11-24 19:15:46 +00:00
parent 2800adba25
commit db44964e27
6 changed files with 54 additions and 29 deletions

View file

@ -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 ) {