From 715b2cd48c5f4bd481a6040aac4251b704c83f25 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Oct 2022 19:16:43 +0200 Subject: [PATCH] Use wxSTATEMENT_MACRO_BEGIN/END in wx/catch_cppunit.h This is more clear and doesn't rely on internal Catch::alwaysFalse() which doesn't exist in Catch v2.x any more. --- include/wx/catch_cppunit.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/wx/catch_cppunit.h b/include/wx/catch_cppunit.h index 413554c6e4..945ba828d8 100644 --- a/include/wx/catch_cppunit.h +++ b/include/wx/catch_cppunit.h @@ -31,10 +31,16 @@ // line but this can happen if they're used inside another macro, so wrap it // inside a scope. #define CPPUNIT_ASSERT_MESSAGE(msg, cond) \ - do { INFO(msg); REQUIRE(cond); } while (Catch::alwaysFalse()) + wxSTATEMENT_MACRO_BEGIN \ + INFO(msg); \ + REQUIRE(cond); \ + wxSTATEMENT_MACRO_END #define CPPUNIT_ASSERT_EQUAL_MESSAGE(msg, x, y) \ - do { INFO(msg); REQUIRE(x == y); } while (Catch::alwaysFalse()) + wxSTATEMENT_MACRO_BEGIN \ + INFO(msg); \ + REQUIRE(x == y); \ + wxSTATEMENT_MACRO_END // CATCH Approx class uses the upper bound of "epsilon*(scale + max(|x|, |y|))" // for |x - y| which is not really compatible with our fixed delta, so we can't