Remove pointless internal macro

This commit is contained in:
Martin Hořeňovský 2024-09-13 13:52:17 +02:00
parent 412cad546a
commit b2b7cbdc31
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 8 additions and 10 deletions

View File

@ -94,7 +94,7 @@ namespace Catch {
do { \ do { \
Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
catchAssertionHandler.handleMessage( 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 ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -38,8 +38,6 @@
#endif #endif
#define INTERNAL_CATCH_REACT( handler ) handler.complete();
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
do { /* NOLINT(bugprone-infinite-loop) */ \ do { /* NOLINT(bugprone-infinite-loop) */ \
@ -52,7 +50,7 @@
catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
} INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look
// The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&. // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&.
@ -80,7 +78,7 @@
catch( ... ) { \ catch( ... ) { \
catchAssertionHandler.handleUnexpectedInflightException(); \ catchAssertionHandler.handleUnexpectedInflightException(); \
} \ } \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -101,7 +99,7 @@
} \ } \
else \ else \
catchAssertionHandler.handleThrowingCallSkipped(); \ catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -125,7 +123,7 @@
} \ } \
else \ else \
catchAssertionHandler.handleThrowingCallSkipped(); \ catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )
@ -149,7 +147,7 @@
} \ } \
else \ else \
catchAssertionHandler.handleThrowingCallSkipped(); \ catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )
#endif // CATCH_CONFIG_DISABLE #endif // CATCH_CONFIG_DISABLE

View File

@ -77,7 +77,7 @@ namespace Catch {
INTERNAL_CATCH_TRY { \ INTERNAL_CATCH_TRY { \
catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \ catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \
} INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )
@ -101,7 +101,7 @@ namespace Catch {
} \ } \
else \ else \
catchAssertionHandler.handleThrowingCallSkipped(); \ catchAssertionHandler.handleThrowingCallSkipped(); \
INTERNAL_CATCH_REACT( catchAssertionHandler ) \ catchAssertionHandler.complete(); \
} while( false ) } while( false )