Skip to content

Commit dc08aee

Browse files
Add Assert-Macros for the TestLogger
Also add a Clear() function to clear existing log content.
1 parent 14de396 commit dc08aee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/base-testloggerfixture.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#include <boost/test/test_tools.hpp>
1212
#include <future>
1313

14+
#define CHECK_LOG_MESSAGE(pattern, timeout) BOOST_CHECK(ExpectLogPattern(pattern, timeout))
15+
#define REQUIRE_LOG_MESSAGE(pattern, timeout) BOOST_REQUIRE(ExpectLogPattern(pattern, timeout))
16+
17+
#define CHECK_NO_LOG_MESSAGE(pattern, timeout) BOOST_CHECK(!ExpectLogPattern(pattern, timeout))
18+
#define REQUIRE_NO_LOG_MESSAGE(pattern, timeout) BOOST_REQUIRE(!ExpectLogPattern(pattern, timeout))
19+
1420
namespace icinga {
1521

1622
class TestLogger : public Logger

0 commit comments

Comments
 (0)