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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/catch_message.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-04-07 13:09:51 +0200
committerMartin Hořeňovský2026-04-07 14:28:11 +0200
commit3ab0d7cef3313d91e652a89870c89b0c42760f9e (patch)
tree5cd6042b65dc6cf5c524edd3a42dea99194533fc /src/catch2/catch_message.cpp
parente83218c2dfdf80fd53526fe389c0a3271696a106 (diff)
downloadcatch3-3ab0d7cef3313d91e652a89870c89b0c42760f9e.tar.gz
Turn IResultCapture::{push,pop}*Message into free functions
The thread-safety changes in assertions & messages turned the message stacks into thread-local state, instead of it being member of `RunContext`. The relevant {push,pop}(Un)ScopedMessage functions were turned from member functions into static functions, but this left `catch_message.hpp` with dependency on `IResultCapture`'s definition for the functions, and thus it still had to include `catch_interfaces_capture.hpp`. With this change, `catch_message.hpp` no longer needs `catch_interfaces_capture.hpp`.
Diffstat (limited to 'src/catch2/catch_message.cpp')
-rw-r--r--src/catch2/catch_message.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/catch2/catch_message.cpp b/src/catch2/catch_message.cpp
index 870651e3..3a83e34e 100644
--- a/src/catch2/catch_message.cpp
+++ b/src/catch2/catch_message.cpp
@@ -5,8 +5,8 @@
// https://www.boost.org/LICENSE_1_0.txt)
// SPDX-License-Identifier: BSL-1.0
+
#include <catch2/catch_message.hpp>
-#include <catch2/interfaces/catch_interfaces_capture.hpp>
#include <catch2/internal/catch_enforce.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
@@ -22,7 +22,7 @@ namespace Catch {
m_messageId( builder.m_info.sequence ) {
MessageInfo info( CATCH_MOVE( builder.m_info ) );
info.message = builder.m_stream.str();
- IResultCapture::pushScopedMessage( CATCH_MOVE( info ) );
+ Detail::pushScopedMessage( CATCH_MOVE( info ) );
}
ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept:
@@ -31,7 +31,7 @@ namespace Catch {
}
ScopedMessage::~ScopedMessage() {
- if ( !m_moved ) { IResultCapture::popScopedMessage( m_messageId ); }
+ if ( !m_moved ) { Detail::popScopedMessage( m_messageId ); }
}
@@ -103,7 +103,7 @@ namespace Catch {
assert( m_captured == m_messages.size() );
if ( m_isScoped ) {
for ( auto const& message : m_messages ) {
- IResultCapture::popScopedMessage( message.sequence );
+ Detail::popScopedMessage( message.sequence );
}
}
}
@@ -112,9 +112,9 @@ namespace Catch {
assert( index < m_messages.size() );
m_messages[index].message += value;
if ( m_isScoped ) {
- IResultCapture::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
+ Detail::pushScopedMessage( CATCH_MOVE( m_messages[index] ) );
} else {
- IResultCapture::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
+ Detail::addUnscopedMessage( CATCH_MOVE( m_messages[index] ) );
}
m_captured++;
}