Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_capture.hpp File Reference
Include dependency graph for catch_capture.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CATCH_INTERNAL_STRINGIFY(...)
 
#define INTERNAL_CATCH_TRY
 
#define INTERNAL_CATCH_CATCH(capturer)
 
#define INTERNAL_CATCH_REACT(handler)
 
#define INTERNAL_CATCH_TEST(macroName, resultDisposition, ...)
 
#define INTERNAL_CATCH_IF(macroName, resultDisposition, ...)
 
#define INTERNAL_CATCH_ELSE(macroName, resultDisposition, ...)
 
#define INTERNAL_CATCH_NO_THROW(macroName, resultDisposition, ...)
 
#define INTERNAL_CATCH_THROWS(macroName, resultDisposition, ...)
 
#define INTERNAL_CATCH_THROWS_AS(macroName, exceptionType, resultDisposition, expr)
 
#define INTERNAL_CATCH_MSG(macroName, messageType, resultDisposition, ...)
 
#define INTERNAL_CATCH_CAPTURE(varName, macroName, ...)
 
#define INTERNAL_CATCH_INFO(macroName, log)
 
#define INTERNAL_CATCH_UNSCOPED_INFO(macroName, log)
 
#define INTERNAL_CATCH_THROWS_STR_MATCHES(macroName, resultDisposition, matcher, ...)
 

Macro Definition Documentation

◆ CATCH_INTERNAL_STRINGIFY

#define CATCH_INTERNAL_STRINGIFY ( ...)
Value:
#__VA_ARGS__

Definition at line 19 of file catch_capture.hpp.

◆ INTERNAL_CATCH_CAPTURE

#define INTERNAL_CATCH_CAPTURE ( varName,
macroName,
... )
Value:
auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
varName.captureValues( 0, __VA_ARGS__ )
#define CATCH_INTERNAL_LINEINFO

Definition at line 125 of file catch_capture.hpp.

125#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
126 auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
127 varName.captureValues( 0, __VA_ARGS__ )

◆ INTERNAL_CATCH_CATCH

#define INTERNAL_CATCH_CATCH ( capturer)

Definition at line 30 of file catch_capture.hpp.

◆ INTERNAL_CATCH_ELSE

#define INTERNAL_CATCH_ELSE ( macroName,
resultDisposition,
... )
Value:
INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
if( !Catch::getResultCapture().lastAssertionPassed() )
#define INTERNAL_CATCH_TEST(macroName, resultDisposition,...)
IResultCapture & getResultCapture()

Definition at line 60 of file catch_capture.hpp.

60#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
61 INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
62 if( !Catch::getResultCapture().lastAssertionPassed() )

◆ INTERNAL_CATCH_IF

#define INTERNAL_CATCH_IF ( macroName,
resultDisposition,
... )
Value:
INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
if( Catch::getResultCapture().lastAssertionPassed() )

Definition at line 55 of file catch_capture.hpp.

55#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
56 INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
57 if( Catch::getResultCapture().lastAssertionPassed() )

◆ INTERNAL_CATCH_INFO

#define INTERNAL_CATCH_INFO ( macroName,
log )
Value:

Definition at line 130 of file catch_capture.hpp.

130#define INTERNAL_CATCH_INFO( macroName, log ) \
131 Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log );

◆ INTERNAL_CATCH_MSG

#define INTERNAL_CATCH_MSG ( macroName,
messageType,
resultDisposition,
... )
Value:
do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( false )

Definition at line 117 of file catch_capture.hpp.

117#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
118 do { \
119 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
120 catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
121 INTERNAL_CATCH_REACT( catchAssertionHandler ) \
122 } while( false )

◆ INTERNAL_CATCH_NO_THROW

#define INTERNAL_CATCH_NO_THROW ( macroName,
resultDisposition,
... )
Value:
do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
try { \
static_cast<void>(__VA_ARGS__); \
catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
} \
catch( ... ) { \
catchAssertionHandler.handleUnexpectedInflightException(); \
} \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( false )
#define CATCH_INTERNAL_STRINGIFY(...)

Definition at line 65 of file catch_capture.hpp.

65#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
66 do { \
67 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
68 try { \
69 static_cast<void>(__VA_ARGS__); \
70 catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
71 } \
72 catch( ... ) { \
73 catchAssertionHandler.handleUnexpectedInflightException(); \
74 } \
75 INTERNAL_CATCH_REACT( catchAssertionHandler ) \
76 } while( false )

◆ INTERNAL_CATCH_REACT

#define INTERNAL_CATCH_REACT ( handler)
Value:
handler.complete();

Definition at line 39 of file catch_capture.hpp.

◆ INTERNAL_CATCH_TEST

#define INTERNAL_CATCH_TEST ( macroName,
resultDisposition,
... )
Value:
do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
} INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( (void)0, (false) && static_cast<bool>( !!(__VA_ARGS__) ) )
#define INTERNAL_CATCH_CATCH(capturer)
#define INTERNAL_CATCH_TRY
#define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS

Definition at line 42 of file catch_capture.hpp.

42#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
43 do { \
44 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
45 INTERNAL_CATCH_TRY { \
46 CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
47 catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
48 CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
49 } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
50 INTERNAL_CATCH_REACT( catchAssertionHandler ) \
51 } while( (void)0, (false) && static_cast<bool>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look

◆ INTERNAL_CATCH_THROWS

#define INTERNAL_CATCH_THROWS ( macroName,
resultDisposition,
... )
Value:
do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
if( catchAssertionHandler.allowThrows() ) \
try { \
static_cast<void>(__VA_ARGS__); \
catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
} \
catch( ... ) { \
catchAssertionHandler.handleExceptionThrownAsExpected(); \
} \
else \
catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( false )

Definition at line 79 of file catch_capture.hpp.

79#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
80 do { \
81 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
82 if( catchAssertionHandler.allowThrows() ) \
83 try { \
84 static_cast<void>(__VA_ARGS__); \
85 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
86 } \
87 catch( ... ) { \
88 catchAssertionHandler.handleExceptionThrownAsExpected(); \
89 } \
90 else \
91 catchAssertionHandler.handleThrowingCallSkipped(); \
92 INTERNAL_CATCH_REACT( catchAssertionHandler ) \
93 } while( false )

◆ INTERNAL_CATCH_THROWS_AS

#define INTERNAL_CATCH_THROWS_AS ( macroName,
exceptionType,
resultDisposition,
expr )
Value:
do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
if( catchAssertionHandler.allowThrows() ) \
try { \
static_cast<void>(expr); \
catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
} \
catch( exceptionType const& ) { \
catchAssertionHandler.handleExceptionThrownAsExpected(); \
} \
catch( ... ) { \
catchAssertionHandler.handleUnexpectedInflightException(); \
} \
else \
catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( false )

Definition at line 96 of file catch_capture.hpp.

96#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
97 do { \
98 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
99 if( catchAssertionHandler.allowThrows() ) \
100 try { \
101 static_cast<void>(expr); \
102 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
103 } \
104 catch( exceptionType const& ) { \
105 catchAssertionHandler.handleExceptionThrownAsExpected(); \
106 } \
107 catch( ... ) { \
108 catchAssertionHandler.handleUnexpectedInflightException(); \
109 } \
110 else \
111 catchAssertionHandler.handleThrowingCallSkipped(); \
112 INTERNAL_CATCH_REACT( catchAssertionHandler ) \
113 } while( false )

◆ INTERNAL_CATCH_THROWS_STR_MATCHES

#define INTERNAL_CATCH_THROWS_STR_MATCHES ( macroName,
resultDisposition,
matcher,
... )
Value:
do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
if( catchAssertionHandler.allowThrows() ) \
try { \
static_cast<void>(__VA_ARGS__); \
catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
} \
catch( ... ) { \
Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
} \
else \
catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( false )

Definition at line 139 of file catch_capture.hpp.

139#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
140 do { \
141 Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
142 if( catchAssertionHandler.allowThrows() ) \
143 try { \
144 static_cast<void>(__VA_ARGS__); \
145 catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
146 } \
147 catch( ... ) { \
148 Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
149 } \
150 else \
151 catchAssertionHandler.handleThrowingCallSkipped(); \
152 INTERNAL_CATCH_REACT( catchAssertionHandler ) \
153 } while( false )

◆ INTERNAL_CATCH_TRY

#define INTERNAL_CATCH_TRY

Definition at line 29 of file catch_capture.hpp.

◆ INTERNAL_CATCH_UNSCOPED_INFO

#define INTERNAL_CATCH_UNSCOPED_INFO ( macroName,
log )
Value:
virtual void emplaceUnscopedMessage(MessageBuilder const &builder)=0

Definition at line 134 of file catch_capture.hpp.

134#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
135 Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )