mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
A load more C++11 tweaks - mostly moving initialisations from constructors to inline
This commit is contained in:
@@ -17,9 +17,7 @@ namespace Catch {
|
||||
|
||||
struct CompactReporter : StreamingReporterBase {
|
||||
|
||||
CompactReporter( ReporterConfig const& _config )
|
||||
: StreamingReporterBase( _config )
|
||||
{}
|
||||
using StreamingReporterBase::StreamingReporterBase;
|
||||
|
||||
virtual ~CompactReporter();
|
||||
|
||||
|
@@ -20,10 +20,7 @@ namespace Catch {
|
||||
|
||||
|
||||
struct ConsoleReporter : StreamingReporterBase {
|
||||
ConsoleReporter( ReporterConfig const& _config )
|
||||
: StreamingReporterBase( _config ),
|
||||
m_headerPrinted( false )
|
||||
{}
|
||||
using StreamingReporterBase::StreamingReporterBase;
|
||||
|
||||
virtual ~ConsoleReporter() override;
|
||||
static std::string getDescription() {
|
||||
@@ -435,7 +432,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_headerPrinted;
|
||||
bool m_headerPrinted = false;
|
||||
};
|
||||
|
||||
INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter )
|
||||
|
@@ -51,8 +51,7 @@ namespace Catch {
|
||||
public:
|
||||
JunitReporter( ReporterConfig const& _config )
|
||||
: CumulativeReporterBase( _config ),
|
||||
xml( _config.stream() ),
|
||||
m_okToFail( false )
|
||||
xml( _config.stream() )
|
||||
{
|
||||
m_reporterPrefs.shouldRedirectStdOut = true;
|
||||
}
|
||||
@@ -233,7 +232,7 @@ namespace Catch {
|
||||
std::ostringstream stdOutForSuite;
|
||||
std::ostringstream stdErrForSuite;
|
||||
unsigned int unexpectedExceptions;
|
||||
bool m_okToFail;
|
||||
bool m_okToFail = false;
|
||||
};
|
||||
|
||||
INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
|
||||
|
@@ -21,10 +21,7 @@ namespace Catch {
|
||||
|
||||
struct TAPReporter : StreamingReporterBase {
|
||||
|
||||
TAPReporter( ReporterConfig const& _config )
|
||||
: StreamingReporterBase( _config ),
|
||||
counter(0)
|
||||
{}
|
||||
using StreamingReporterBase::StreamingReporterBase;
|
||||
|
||||
virtual ~TAPReporter();
|
||||
|
||||
@@ -62,7 +59,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
private:
|
||||
size_t counter;
|
||||
size_t counter = 0;
|
||||
class AssertionPrinter {
|
||||
void operator= ( AssertionPrinter const& );
|
||||
public:
|
||||
|
@@ -25,8 +25,7 @@ namespace Catch {
|
||||
|
||||
struct TeamCityReporter : StreamingReporterBase {
|
||||
TeamCityReporter( ReporterConfig const& _config )
|
||||
: StreamingReporterBase( _config ),
|
||||
m_headerPrintedForThisSection( false )
|
||||
: StreamingReporterBase( _config )
|
||||
{
|
||||
m_reporterPrefs.shouldRedirectStdOut = true;
|
||||
}
|
||||
@@ -198,7 +197,7 @@ namespace Catch {
|
||||
.setInitialIndent( indent ) ) << "\n";
|
||||
}
|
||||
private:
|
||||
bool m_headerPrintedForThisSection;
|
||||
bool m_headerPrintedForThisSection = false;
|
||||
};
|
||||
|
||||
#ifdef CATCH_IMPL
|
||||
|
@@ -20,8 +20,7 @@ namespace Catch {
|
||||
public:
|
||||
XmlReporter( ReporterConfig const& _config )
|
||||
: StreamingReporterBase( _config ),
|
||||
m_xml(_config.stream()),
|
||||
m_sectionDepth( 0 )
|
||||
m_xml(_config.stream())
|
||||
{
|
||||
m_reporterPrefs.shouldRedirectStdOut = true;
|
||||
}
|
||||
@@ -219,7 +218,7 @@ namespace Catch {
|
||||
private:
|
||||
Timer m_testCaseTimer;
|
||||
XmlWriter m_xml;
|
||||
int m_sectionDepth;
|
||||
int m_sectionDepth = 0;
|
||||
};
|
||||
|
||||
INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter )
|
||||
|
Reference in New Issue
Block a user