mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-06 23:40:55 +00:00
Refactored most handle() calls to more specific/ descriptive calls
This commit is contained in:
parent
2800adba25
commit
db44964e27
6 changed files with 54 additions and 29 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue