test: Mark ~DebugLogHelper as noexcept(false)

We mark ~DebugLogHelper as noexcept(false) to be able to catch the
exception it throws. This lets us use it in test in combination with
BOOST_CHECK_THROW and BOOST_CHECK_NO_THROW to check that certain log
messages are (not) logged.

Co-Authored-By: Niklas Gogge <n.goeggi@gmail.com>

Github-Pull: #32604
Rebased-From: df7972a6cf
This commit is contained in:
Eugene Siegel
2025-06-05 13:47:49 -04:00
committed by fanquake
parent 837c5c7fd8
commit 4987c03531

View File

@@ -33,7 +33,9 @@ class DebugLogHelper
public:
explicit DebugLogHelper(std::string message, MatchFn match = [](const std::string*){ return true; });
~DebugLogHelper() { check_found(); }
//! Mark as noexcept(false) to catch any thrown exceptions.
~DebugLogHelper() noexcept(false) { check_found(); }
};
#define ASSERT_DEBUG_LOG(message) DebugLogHelper UNIQUE_NAME(debugloghelper)(message)