mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-02 14:13:19 +02:00
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>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user