From 252d809256b0f4469aec3cc5254672fdc777d863 Mon Sep 17 00:00:00 2001 From: Johannes Schmidt Date: Mon, 29 Sep 2025 11:00:27 +0200 Subject: [PATCH] Add Assert-Macros for the TestLogger Also add a Clear() function to clear existing log content. --- test/base-testloggerfixture.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/base-testloggerfixture.hpp b/test/base-testloggerfixture.hpp index d17cdda30..971ddce3b 100644 --- a/test/base-testloggerfixture.hpp +++ b/test/base-testloggerfixture.hpp @@ -10,6 +10,12 @@ #include #include +#define CHECK_LOG_MESSAGE(pattern, timeout) BOOST_CHECK(ExpectLogPattern(pattern, timeout)) +#define REQUIRE_LOG_MESSAGE(pattern, timeout) BOOST_REQUIRE(ExpectLogPattern(pattern, timeout)) + +#define CHECK_NO_LOG_MESSAGE(pattern, timeout) BOOST_CHECK(!ExpectLogPattern(pattern, timeout)) +#define REQUIRE_NO_LOG_MESSAGE(pattern, timeout) BOOST_REQUIRE(!ExpectLogPattern(pattern, timeout)) + namespace icinga { class TestLogger : public Logger