Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::AssertionHandler Class Reference

#include <catch_assertionhandler.h>

Public Member Functions

 AssertionHandler (StringRef const &macroName, SourceLineInfo const &lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition)
 
 ~AssertionHandler ()
 
template<typename T >
void handleExpr (ExprLhs< T > const &expr)
 
void handleExpr (ITransientExpression const &expr)
 
void handleMessage (ResultWas::OfType resultType, StringRef const &message)
 
void handleExceptionThrownAsExpected ()
 
void handleUnexpectedExceptionNotThrown ()
 
void handleExceptionNotThrownAsExpected ()
 
void handleThrowingCallSkipped ()
 
void handleUnexpectedInflightException ()
 
void complete ()
 
void setCompleted ()
 
auto allowThrows () const -> bool
 
 AssertionHandler (StringRef const &macroName, SourceLineInfo const &lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition)
 
 ~AssertionHandler ()
 
template<typename T >
void handleExpr (ExprLhs< T > const &expr)
 
void handleExpr (ITransientExpression const &expr)
 
void handleMessage (ResultWas::OfType resultType, StringRef const &message)
 
void handleExceptionThrownAsExpected ()
 
void handleUnexpectedExceptionNotThrown ()
 
void handleExceptionNotThrownAsExpected ()
 
void handleThrowingCallSkipped ()
 
void handleUnexpectedInflightException ()
 
void complete ()
 
void setCompleted ()
 
auto allowThrows () const -> bool
 

Detailed Description

Definition at line 2173 of file catch.hpp.

Constructor & Destructor Documentation

◆ AssertionHandler() [1/2]

Catch::AssertionHandler::AssertionHandler ( StringRef const & macroName,
SourceLineInfo const & lineInfo,
StringRef capturedExpression,
ResultDisposition::Flags resultDisposition )

Definition at line 54 of file catch_assertionhandler.cpp.

59 : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
60 m_resultCapture( getResultCapture() )
61 {}
IResultCapture & getResultCapture()

◆ ~AssertionHandler() [1/2]

Catch::AssertionHandler::~AssertionHandler ( )
inline

Definition at line 56 of file catch_assertionhandler.h.

56 {
57 if ( !m_completed ) {
58 m_resultCapture.handleIncomplete( m_assertionInfo );
59 }
60 }
virtual void handleIncomplete(AssertionInfo const &info)=0
Here is the call graph for this function:

◆ AssertionHandler() [2/2]

Catch::AssertionHandler::AssertionHandler ( StringRef const & macroName,
SourceLineInfo const & lineInfo,
StringRef capturedExpression,
ResultDisposition::Flags resultDisposition )

◆ ~AssertionHandler() [2/2]

Catch::AssertionHandler::~AssertionHandler ( )
inline

Definition at line 2185 of file catch.hpp.

2185 {
2186 if ( !m_completed ) {
2187 m_resultCapture.handleIncomplete( m_assertionInfo );
2188 }
2189 }
Here is the call graph for this function:

Member Function Documentation

◆ allowThrows() [1/2]

auto Catch::AssertionHandler::allowThrows ( ) const -> bool

Definition at line 70 of file catch_assertionhandler.cpp.

70 {
71 return getCurrentContext().getConfig()->allowThrows();
72 }
IContext & getCurrentContext()
virtual IConfigPtr const & getConfig() const =0
Here is the call graph for this function:

◆ allowThrows() [2/2]

auto Catch::AssertionHandler::allowThrows ( ) const -> bool

◆ complete() [1/2]

void Catch::AssertionHandler::complete ( )

Definition at line 74 of file catch_assertionhandler.cpp.

74 {
76 if( m_reaction.shouldDebugBreak ) {
77
78 // If you find your debugger stopping you here then go one level up on the
79 // call-stack for the code that caused it (typically a failed assertion)
80
81 // (To go back to the test and change execution, jump over the throw, next)
83 }
84 if (m_reaction.shouldThrow) {
85#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
87#else
88 CATCH_ERROR( "Test failure requires aborting test!" );
89#endif
90 }
91 }
#define CATCH_BREAK_INTO_DEBUGGER()
#define CATCH_ERROR(msg)
Here is the call graph for this function:

◆ complete() [2/2]

void Catch::AssertionHandler::complete ( )

◆ handleExceptionNotThrownAsExpected() [1/2]

void Catch::AssertionHandler::handleExceptionNotThrownAsExpected ( )

Definition at line 103 of file catch_assertionhandler.cpp.

103 {
104 m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
105 }
virtual void handleNonExpr(AssertionInfo const &info, ResultWas::OfType resultType, AssertionReaction &reaction)=0
Here is the call graph for this function:

◆ handleExceptionNotThrownAsExpected() [2/2]

void Catch::AssertionHandler::handleExceptionNotThrownAsExpected ( )

◆ handleExceptionThrownAsExpected() [1/2]

void Catch::AssertionHandler::handleExceptionThrownAsExpected ( )

Definition at line 100 of file catch_assertionhandler.cpp.

100 {
101 m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
102 }
Here is the call graph for this function:

◆ handleExceptionThrownAsExpected() [2/2]

void Catch::AssertionHandler::handleExceptionThrownAsExpected ( )

◆ handleExpr() [1/4]

template<typename T >
void Catch::AssertionHandler::handleExpr ( ExprLhs< T > const & expr)
inline

Definition at line 64 of file catch_assertionhandler.h.

64 {
65 handleExpr( expr.makeUnaryExpr() );
66 }
void handleExpr(ExprLhs< T > const &expr)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleExpr() [2/4]

template<typename T >
void Catch::AssertionHandler::handleExpr ( ExprLhs< T > const & expr)
inline

Definition at line 2192 of file catch.hpp.

2192 {
2193 handleExpr( expr.makeUnaryExpr() );
2194 }
Here is the call graph for this function:

◆ handleExpr() [3/4]

void Catch::AssertionHandler::handleExpr ( ITransientExpression const & expr)

Definition at line 63 of file catch_assertionhandler.cpp.

63 {
64 m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
65 }
virtual void handleExpr(AssertionInfo const &info, ITransientExpression const &expr, AssertionReaction &reaction)=0
Here is the call graph for this function:

◆ handleExpr() [4/4]

void Catch::AssertionHandler::handleExpr ( ITransientExpression const & expr)

◆ handleMessage() [1/2]

void Catch::AssertionHandler::handleMessage ( ResultWas::OfType resultType,
StringRef const & message )

Definition at line 66 of file catch_assertionhandler.cpp.

66 {
67 m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction );
68 }
virtual void handleMessage(AssertionInfo const &info, ResultWas::OfType resultType, StringRef const &message, AssertionReaction &reaction)=0
Here is the call graph for this function:

◆ handleMessage() [2/2]

void Catch::AssertionHandler::handleMessage ( ResultWas::OfType resultType,
StringRef const & message )

◆ handleThrowingCallSkipped() [1/2]

void Catch::AssertionHandler::handleThrowingCallSkipped ( )

Definition at line 111 of file catch_assertionhandler.cpp.

111 {
112 m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
113 }
Here is the call graph for this function:

◆ handleThrowingCallSkipped() [2/2]

void Catch::AssertionHandler::handleThrowingCallSkipped ( )

◆ handleUnexpectedExceptionNotThrown() [1/2]

void Catch::AssertionHandler::handleUnexpectedExceptionNotThrown ( )

Definition at line 107 of file catch_assertionhandler.cpp.

107 {
108 m_resultCapture.handleUnexpectedExceptionNotThrown( m_assertionInfo, m_reaction );
109 }
virtual void handleUnexpectedExceptionNotThrown(AssertionInfo const &info, AssertionReaction &reaction)=0
Here is the call graph for this function:

◆ handleUnexpectedExceptionNotThrown() [2/2]

void Catch::AssertionHandler::handleUnexpectedExceptionNotThrown ( )

◆ handleUnexpectedInflightException() [1/2]

void Catch::AssertionHandler::handleUnexpectedInflightException ( )

Definition at line 96 of file catch_assertionhandler.cpp.

96 {
97 m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
98 }
std::string translateActiveException()
virtual void handleUnexpectedInflightException(AssertionInfo const &info, std::string const &message, AssertionReaction &reaction)=0
Here is the call graph for this function:

◆ handleUnexpectedInflightException() [2/2]

void Catch::AssertionHandler::handleUnexpectedInflightException ( )

◆ setCompleted() [1/2]

void Catch::AssertionHandler::setCompleted ( )

Definition at line 92 of file catch_assertionhandler.cpp.

92 {
93 m_completed = true;
94 }
Here is the caller graph for this function:

◆ setCompleted() [2/2]

void Catch::AssertionHandler::setCompleted ( )

The documentation for this class was generated from the following files: