diff options
| author | Martin Hořeňovský | 2025-08-26 12:36:06 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-08-26 12:37:52 +0200 |
| commit | 227af796b4ede6258f9b1ff8b69cd1f03d32f662 (patch) | |
| tree | cfffe971cbc8d28b4de33c3f87bd590050c679dd /src/catch2/internal | |
| parent | 33adb4c779feaa3a98bb45ec1ebaf2864bb110b7 (diff) | |
| download | catch3-227af796b4ede6258f9b1ff8b69cd1f03d32f662.tar.gz | |
Move MessageInfos into the run context
Together with the previous change, this means that `ScopedMessage`
only needs to keep around a single unsigned int.
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_run_context.cpp | 4 | ||||
| -rw-r--r-- | src/catch2/internal/catch_run_context.hpp | 2 |
2 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 b6edddb3..3ca15fd0 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -483,8 +483,8 @@ namespace Catch { m_reporter->benchmarkFailed( error ); } - void RunContext::pushScopedMessage( MessageInfo const& message ) { - Detail::g_messages.push_back( message ); + void RunContext::pushScopedMessage( MessageInfo&& message ) { + Detail::g_messages.push_back( CATCH_MOVE(message) ); } void RunContext::popScopedMessage( unsigned int messageId ) { diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp index 892926a0..1ff9caf6 100644 --- a/src/catch2/internal/catch_run_context.hpp +++ b/src/catch2/internal/catch_run_context.hpp @@ -94,7 +94,7 @@ namespace Catch { void benchmarkEnded( BenchmarkStats<> const& stats ) override; void benchmarkFailed( StringRef error ) override; - void pushScopedMessage( MessageInfo const& message ) override; + void pushScopedMessage( MessageInfo&& message ) override; void popScopedMessage( unsigned int messageId ) override; void emplaceUnscopedMessage( MessageBuilder&& builder ) override; |