mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-04 05:09:53 +01:00
Renamed last usge specific handle method (and made the low level ones private)
This commit is contained in:
parent
e344984a1b
commit
5461242ffe
@ -63,7 +63,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
AssertionHandler::~AssertionHandler() {
|
AssertionHandler::~AssertionHandler() {
|
||||||
if ( !m_completed ) {
|
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();
|
m_resultCapture.exceptionEarlyReported();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ namespace Catch {
|
|||||||
void AssertionHandler::handle( ResultWas::OfType resultType ) {
|
void AssertionHandler::handle( ResultWas::OfType resultType ) {
|
||||||
handle( resultType, nullptr, false );
|
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 ) );
|
AssertionResultData data( resultType, LazyExpression( false ) );
|
||||||
data.message = message;
|
data.message = message;
|
||||||
handle( data, nullptr );
|
handle( data, nullptr );
|
||||||
@ -133,7 +133,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AssertionHandler::handleUnexpectedInflightException() {
|
void AssertionHandler::handleUnexpectedInflightException() {
|
||||||
handle( ResultWas::ThrewException, Catch::translateActiveException() );
|
handleMessage(ResultWas::ThrewException, Catch::translateActiveException());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssertionHandler::handleExceptionThrownAsExpected() {
|
void AssertionHandler::handleExceptionThrownAsExpected() {
|
||||||
@ -151,7 +151,6 @@ namespace Catch {
|
|||||||
handle( Catch::ResultWas::Ok );
|
handle( Catch::ResultWas::Ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This is the overload that takes a string and infers the Equals matcher from it
|
// 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
|
// 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 ) {
|
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) {
|
||||||
|
@ -54,9 +54,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
void handleExpr( ITransientExpression const& expr );
|
void handleExpr( ITransientExpression const& expr );
|
||||||
|
|
||||||
void handle( ResultWas::OfType resultType, StringRef const& message );
|
void handleMessage(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 handleExceptionThrownAsExpected();
|
void handleExceptionThrownAsExpected();
|
||||||
void handleUnexpectedExceptionNotThrown();
|
void handleUnexpectedExceptionNotThrown();
|
||||||
@ -72,6 +70,8 @@ namespace Catch {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void handle( ResultWas::OfType resultType );
|
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 );
|
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString );
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
|
#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
|
||||||
do { \
|
do { \
|
||||||
Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
|
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 ) \
|
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
|
||||||
} while( false )
|
} while( false )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user