unittest-cpp/UnitTest++/RequiredCheckTestReporter.cpp
Patrick Johnmeyer 5eec0a255f Simplify required check reporter interactions
Was able to remove ThrowingTestReporter::SetDecorated and
::GetDecorated by changing RequiredCheckTestReporter to accept
its TestResults by reference. This simple change removed
several if-checks and some functions.
2016-02-06 09:30:15 -06:00

26 lines
No EOL
623 B
C++

#include "RequiredCheckTestReporter.h"
#include "CurrentTest.h"
#include "TestResults.h"
namespace UnitTest {
RequiredCheckTestReporter::RequiredCheckTestReporter(TestResults& results)
: m_results(results)
, m_originalTestReporter(results.m_testReporter)
, m_throwingReporter(results.m_testReporter)
, m_continue(0)
{
m_results.m_testReporter = &m_throwingReporter;
}
RequiredCheckTestReporter::~RequiredCheckTestReporter()
{
m_results.m_testReporter = m_originalTestReporter;
}
bool RequiredCheckTestReporter::Next()
{
return m_continue++ == 0;
}
}