Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_run_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-08-26 12:07:41 +0200
committerMartin Hořeňovský2025-08-26 12:07:41 +0200
commit33adb4c779feaa3a98bb45ec1ebaf2864bb110b7 (patch)
tree4ca33028e7d91ca0196b292815ad44779f0a67dd /src/catch2/internal/catch_run_context.cpp
parent25319fd3047c6bdcf3c0170e76fa526c77f99ca9 (diff)
downloadcatch3-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.cpp6
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;
} ) );
}