From b2b7cbdc319af3103153ce68def6ef17a431fcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 13 Sep 2024 13:52:17 +0200 Subject: [PATCH] Remove pointless internal macro --- src/catch2/catch_message.hpp | 2 +- src/catch2/internal/catch_test_macro_impl.hpp | 12 +++++------- src/catch2/matchers/internal/catch_matchers_impl.hpp | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/catch2/catch_message.hpp b/src/catch2/catch_message.hpp index 05325ee8..0a738341 100644 --- a/src/catch2/catch_message.hpp +++ b/src/catch2/catch_message.hpp @@ -94,7 +94,7 @@ namespace Catch { 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 ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// diff --git a/src/catch2/internal/catch_test_macro_impl.hpp b/src/catch2/internal/catch_test_macro_impl.hpp index 0d95650f..ccd5bb35 100644 --- a/src/catch2/internal/catch_test_macro_impl.hpp +++ b/src/catch2/internal/catch_test_macro_impl.hpp @@ -38,8 +38,6 @@ #endif -#define INTERNAL_CATCH_REACT( handler ) handler.complete(); - /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \ do { /* NOLINT(bugprone-infinite-loop) */ \ @@ -52,7 +50,7 @@ catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); /* NOLINT(bugprone-chained-comparison) */ \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( (void)0, (false) && static_cast( !!(__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 &&. @@ -80,7 +78,7 @@ catch( ... ) { \ catchAssertionHandler.handleUnexpectedInflightException(); \ } \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -101,7 +99,7 @@ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) /////////////////////////////////////////////////////////////////////////////// @@ -125,7 +123,7 @@ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -149,7 +147,7 @@ } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) #endif // CATCH_CONFIG_DISABLE diff --git a/src/catch2/matchers/internal/catch_matchers_impl.hpp b/src/catch2/matchers/internal/catch_matchers_impl.hpp index fd4aaca0..06884c4a 100644 --- a/src/catch2/matchers/internal/catch_matchers_impl.hpp +++ b/src/catch2/matchers/internal/catch_matchers_impl.hpp @@ -77,7 +77,7 @@ namespace Catch { INTERNAL_CATCH_TRY { \ catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher ) ); \ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false ) @@ -101,7 +101,7 @@ namespace Catch { } \ else \ catchAssertionHandler.handleThrowingCallSkipped(); \ - INTERNAL_CATCH_REACT( catchAssertionHandler ) \ + catchAssertionHandler.complete(); \ } while( false )