A load more C++11 tweaks - mostly moving initialisations from constructors to inline

This commit is contained in:
Phil Nash
2017-04-25 18:56:53 +01:00
parent cc8206f4c3
commit e749724a11
23 changed files with 64 additions and 145 deletions

View File

@@ -17,9 +17,7 @@ namespace Catch {
struct CompactReporter : StreamingReporterBase {
CompactReporter( ReporterConfig const& _config )
: StreamingReporterBase( _config )
{}
using StreamingReporterBase::StreamingReporterBase;
virtual ~CompactReporter();

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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:

View File

@@ -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

View File

@@ -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 )