mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
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.
26 lines
No EOL
623 B
C++
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;
|
|
}
|
|
} |