Renamed last usge specific handle method (and made the low level ones private)

This commit is contained in:
Phil Nash 2017-11-27 06:53:56 +00:00
parent e344984a1b
commit 5461242ffe
3 changed files with 7 additions and 8 deletions

View File

@ -63,7 +63,7 @@ namespace Catch {
}
AssertionHandler::~AssertionHandler() {
if ( !m_completed ) {
handle( ResultWas::ThrewException, "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE" );
handleMessage(ResultWas::ThrewException, "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE");
m_resultCapture.exceptionEarlyReported();
}
}
@ -85,7 +85,7 @@ namespace Catch {
void AssertionHandler::handle( ResultWas::OfType resultType ) {
handle( resultType, nullptr, false );
}
void AssertionHandler::handle( ResultWas::OfType resultType, StringRef const& message ) {
void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const &message) {
AssertionResultData data( resultType, LazyExpression( false ) );
data.message = message;
handle( data, nullptr );
@ -133,7 +133,7 @@ namespace Catch {
}
void AssertionHandler::handleUnexpectedInflightException() {
handle( ResultWas::ThrewException, Catch::translateActiveException() );
handleMessage(ResultWas::ThrewException, Catch::translateActiveException());
}
void AssertionHandler::handleExceptionThrownAsExpected() {
@ -151,7 +151,6 @@ namespace Catch {
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 ) {

View File

@ -54,9 +54,7 @@ namespace Catch {
}
void handleExpr( ITransientExpression const& expr );
void handle( ResultWas::OfType resultType, StringRef const& message );
void handle( ResultWas::OfType resultType, ITransientExpression const* expr, bool negated );
void handle( AssertionResultData const& resultData, ITransientExpression const* expr );
void handleMessage(ResultWas::OfType resultType, StringRef const &message);
void handleExceptionThrownAsExpected();
void handleUnexpectedExceptionNotThrown();
@ -72,6 +70,8 @@ namespace Catch {
private:
void handle( ResultWas::OfType resultType );
void handle( ResultWas::OfType resultType, ITransientExpression const* expr, bool negated );
void handle( AssertionResultData const& resultData, ITransientExpression const* expr );
};
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString );

View File

@ -116,7 +116,7 @@
#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
do { \
Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
catchAssertionHandler.handle( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( false )