Reporter interface uses value types instead of shared ptrs again

This commit is contained in:
Phil Nash 2013-01-03 09:04:46 +00:00
parent 7409075302
commit bcf722eb81
6 changed files with 178 additions and 83 deletions

View file

@ -73,7 +73,7 @@ namespace Catch {
}
virtual ~Runner() {
m_reporter->testRunEnded( new TestRunStats( m_runInfo, m_totals, aborting() ) );
m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) );
m_context.setRunner( m_prevRunner );
m_context.setConfig( NULL );
m_context.setResultCapture( m_prevResultCapture );
@ -84,7 +84,7 @@ namespace Catch {
m_reporter->testGroupStarting( GroupInfo( testSpec ) );
}
void testGroupEnded( std::string const& testSpec, Totals const& totals ) {
m_reporter->testGroupEnded( new TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) );
m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec ), totals, aborting() ) );
}
Totals runMatching( const std::string& testSpec ) {
@ -135,12 +135,12 @@ namespace Catch {
m_totals.testCases += deltaTotals.testCases;
m_reporter->testCaseEnded( new TestCaseStats( testInfo,
deltaTotals,
redirectedCout,
redirectedCerr,
missingAssertions,
aborting() ) );
m_reporter->testCaseEnded( TestCaseStats( testInfo,
deltaTotals,
redirectedCout,
redirectedCerr,
missingAssertions,
aborting() ) );
delete m_runningTest;
@ -171,13 +171,13 @@ namespace Catch {
std::vector<ScopedInfo*>::const_iterator it = m_scopedInfos.begin();
std::vector<ScopedInfo*>::const_iterator itEnd = m_scopedInfos.end();
for(; it != itEnd; ++it )
m_reporter->assertionEnded( new AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) );
m_reporter->assertionEnded( AssertionStats( (*it)->buildResult( m_lastAssertionInfo ), m_totals ) );
}
{
std::vector<AssertionResult>::const_iterator it = m_assertionResults.begin();
std::vector<AssertionResult>::const_iterator itEnd = m_assertionResults.end();
for(; it != itEnd; ++it )
m_reporter->assertionEnded( new AssertionStats( *it, m_totals ) );
m_reporter->assertionEnded( AssertionStats( *it, m_totals ) );
}
m_assertionResults.clear();
}
@ -188,7 +188,7 @@ namespace Catch {
m_totals.assertions.info++;
}
else
m_reporter->assertionEnded( new AssertionStats( result, m_totals ) );
m_reporter->assertionEnded( AssertionStats( result, m_totals ) );
// Reset AssertionInfo
m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after this line}" , m_lastAssertionInfo.resultDisposition );
@ -228,7 +228,7 @@ namespace Catch {
}
m_runningTest->endSection( info.name );
m_reporter->sectionEnded( new SectionStats( info, assertions, missingAssertions ) );
m_reporter->sectionEnded( SectionStats( info, assertions, missingAssertions ) );
}
virtual void pushScopedInfo( ScopedInfo* scopedInfo ) {