mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 23:19:32 +00:00
INFO and CAPTURE are now scoped
- SCOPED_INFO and SCOPED_CAPTURE are now just aliases
This commit is contained in:
parent
881c61b67f
commit
b5fd5a6496
9 changed files with 190 additions and 241 deletions
|
@ -24,31 +24,17 @@ namespace Catch {
|
|||
// This may need protecting if threading support is added
|
||||
unsigned int MessageInfo::globalCount = 0;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MessageBuilder::MessageBuilder( std::string const& _macroName,
|
||||
SourceLineInfo const& _lineInfo,
|
||||
ResultWas::OfType _type )
|
||||
: MessageInfo( _macroName, _lineInfo, _type )
|
||||
{}
|
||||
|
||||
MessageInfo MessageBuilder::build() const {
|
||||
MessageInfo message = *this;
|
||||
message.message = stream.str();
|
||||
return message;
|
||||
ScopedMessage::ScopedMessage( MessageBuilder const& builder )
|
||||
: m_info( builder.m_info )
|
||||
{
|
||||
m_info.message = builder.m_stream.str();
|
||||
getResultCapture().pushScopedMessage( m_info );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ScopedMessageBuilder::ScopedMessageBuilder
|
||||
( std::string const& _macroName,
|
||||
SourceLineInfo const& _lineInfo,
|
||||
ResultWas::OfType _type )
|
||||
: MessageBuilder( _macroName, _lineInfo, _type )
|
||||
{}
|
||||
|
||||
ScopedMessageBuilder::~ScopedMessageBuilder() {
|
||||
getResultCapture().popScopedMessage( *this );
|
||||
ScopedMessage::~ScopedMessage() {
|
||||
getResultCapture().popScopedMessage( m_info );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue