Fixed SCOPED_INFO (#123)

This commit is contained in:
Phil Nash 2012-09-24 08:28:23 +01:00
parent 5f66d1d001
commit ec2fccf6b8
2 changed files with 14 additions and 6 deletions

View File

@ -35,8 +35,8 @@ public:
return *this; return *this;
} }
std::string getInfo () const { ResultInfo getInfo () const {
return m_oss.str(); return ResultInfo( "", ResultWas::Info, false, SourceLineInfo(), "SCOPED_INFO", m_oss.str().c_str() );
} }
private: private:

View File

@ -156,10 +156,18 @@ namespace Catch {
else if( !result.ok() ) { else if( !result.ok() ) {
m_totals.assertions.failed++; m_totals.assertions.failed++;
{
std::vector<ScopedInfo*>::const_iterator it = m_scopedInfos.begin();
std::vector<ScopedInfo*>::const_iterator itEnd = m_scopedInfos.end();
for(; it != itEnd; ++it )
m_reporter->Result( (*it)->getInfo() );
}
{
std::vector<ResultInfo>::const_iterator it = m_info.begin(); std::vector<ResultInfo>::const_iterator it = m_info.begin();
std::vector<ResultInfo>::const_iterator itEnd = m_info.end(); std::vector<ResultInfo>::const_iterator itEnd = m_info.end();
for(; it != itEnd; ++it ) for(; it != itEnd; ++it )
m_reporter->Result( *it ); m_reporter->Result( *it );
}
m_info.clear(); m_info.clear();
} }