diff options
| author | Martin Hořeňovský | 2025-08-26 12:07:41 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-08-26 12:07:41 +0200 |
| commit | 33adb4c779feaa3a98bb45ec1ebaf2864bb110b7 (patch) | |
| tree | 4ca33028e7d91ca0196b292815ad44779f0a67dd /src/catch2/internal/catch_run_context.cpp | |
| parent | 25319fd3047c6bdcf3c0170e76fa526c77f99ca9 (diff) | |
| download | catch3-33adb4c779feaa3a98bb45ec1ebaf2864bb110b7.tar.gz | |
Use only the ID of a message when removing it from context
Diffstat (limited to 'src/catch2/internal/catch_run_context.cpp')
| -rw-r--r-- | src/catch2/internal/catch_run_context.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index d1cec82c..b6edddb3 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -487,7 +487,7 @@ namespace Catch { Detail::g_messages.push_back( message ); } - void RunContext::popScopedMessage( MessageInfo const& message ) { + void RunContext::popScopedMessage( unsigned int messageId ) { // Note: On average, it would probably be better to look for the message // backwards. However, we do not expect to have to deal with more // messages than low single digits, so the optimization is tiny, @@ -496,8 +496,8 @@ namespace Catch { Detail::g_messages.erase( std::find_if( Detail::g_messages.begin(), Detail::g_messages.end(), - [id = message.sequence]( MessageInfo const& msg ) { - return msg.sequence == id; + [=]( MessageInfo const& msg ) { + return msg.sequence == messageId; } ) ); } |