INFO and CAPTURE are now scoped

- SCOPED_INFO and SCOPED_CAPTURE are now just aliases
This commit is contained in:
Phil Nash 2013-06-28 17:09:57 +01:00
parent 881c61b67f
commit b5fd5a6496
9 changed files with 190 additions and 241 deletions

View file

@ -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 );
}