Stripped trailing whitespace from all source code lines

(replaces need for PRs #310 and #504)
This commit is contained in:
Phil Nash
2015-11-04 18:01:28 +00:00
parent 8c32b49d5f
commit e91738103c
47 changed files with 398 additions and 398 deletions

View File

@@ -230,18 +230,18 @@ namespace Catch {
return line;
}
struct TestEventListenerBase : StreamingReporterBase {
TestEventListenerBase( ReporterConfig const& _config )
: StreamingReporterBase( _config )
{}
virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {}
virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE {
return false;
}
};
} // end namespace Catch
#endif // TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED

View File

@@ -104,7 +104,7 @@ namespace Catch {
SectionNode const& rootSection = *testCaseNode.children.front();
std::string className = stats.testInfo.className;
if( className.empty() ) {
if( rootSection.childSections.empty() )
className = "global";
@@ -118,7 +118,7 @@ namespace Catch {
std::string name = trim( sectionNode.stats.sectionInfo.name );
if( !rootName.empty() )
name = rootName + "/" + name;
if( !sectionNode.assertions.empty() ||
!sectionNode.stdOut.empty() ||
!sectionNode.stdErr.empty() ) {
@@ -187,7 +187,7 @@ namespace Catch {
elementName = "internalError";
break;
}
XmlWriter::ScopedElement e = xml.scopedElement( elementName );
xml.writeAttribute( "message", result.getExpandedExpression() );
@@ -216,7 +216,7 @@ namespace Catch {
unsigned int unexpectedExceptions;
};
INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
} // end namespace Catch

View File

@@ -15,18 +15,18 @@ namespace Catch {
class MultipleReporters : public SharedImpl<IStreamingReporter> {
typedef std::vector<Ptr<IStreamingReporter> > Reporters;
Reporters m_reporters;
public:
void add( Ptr<IStreamingReporter> const& reporter ) {
m_reporters.push_back( reporter );
}
public: // IStreamingReporter
virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE {
return m_reporters[0]->getPreferences();
}
virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE {
for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
it != itEnd;
@@ -34,7 +34,7 @@ public: // IStreamingReporter
(*it)->noMatchingTestCases( spec );
}
virtual void testRunStarting( TestRunInfo const& testRunInfo ) CATCH_OVERRIDE {
for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
it != itEnd;
@@ -49,7 +49,7 @@ public: // IStreamingReporter
(*it)->testGroupStarting( groupInfo );
}
virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE {
for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
it != itEnd;
@@ -64,7 +64,7 @@ public: // IStreamingReporter
(*it)->sectionStarting( sectionInfo );
}
virtual void assertionStarting( AssertionInfo const& assertionInfo ) CATCH_OVERRIDE {
for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
it != itEnd;
@@ -72,7 +72,7 @@ public: // IStreamingReporter
(*it)->assertionStarting( assertionInfo );
}
// The return value indicates if the messages buffer should be cleared:
virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE {
bool clearBuffer = false;
@@ -111,7 +111,7 @@ public: // IStreamingReporter
(*it)->testRunEnded( testRunStats );
}
virtual void skipTest( TestCaseInfo const& testInfo ) CATCH_OVERRIDE {
for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
it != itEnd;
@@ -122,7 +122,7 @@ public: // IStreamingReporter
Ptr<IStreamingReporter> addReporter( Ptr<IStreamingReporter> const& existingReporter, Ptr<IStreamingReporter> const& additionalReporter ) {
Ptr<IStreamingReporter> resultingReporter;
if( existingReporter ) {
MultipleReporters* multi = dynamic_cast<MultipleReporters*>( existingReporter.get() );
if( !multi ) {
@@ -137,11 +137,11 @@ Ptr<IStreamingReporter> addReporter( Ptr<IStreamingReporter> const& existingRepo
}
else
resultingReporter = additionalReporter;
return resultingReporter;
}
} // end namespace Catch
#endif // TWOBLUECUBES_CATCH_REPORTER_MULTI_HPP_INCLUDED

View File

@@ -24,7 +24,7 @@
#endif
namespace Catch {
struct TeamCityReporter : StreamingReporterBase {
TeamCityReporter( ReporterConfig const& _config )
: StreamingReporterBase( _config ),
@@ -32,7 +32,7 @@ namespace Catch {
{
m_reporterPrefs.shouldRedirectStdOut = true;
}
static std::string escape( std::string const& str ) {
std::string escaped = str;
replaceInPlace( escaped, "|", "||" );
@@ -58,9 +58,9 @@ namespace Catch {
stream << " message='test skipped because it didn|'t match the test spec'";
stream << "]\n";
}
virtual void noMatchingTestCases( std::string const& /* spec */ ) CATCH_OVERRIDE {}
virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE {
StreamingReporterBase::testGroupStarting( groupInfo );
stream << "##teamcity[testSuiteStarted name='"
@@ -72,21 +72,21 @@ namespace Catch {
<< escape( testGroupStats.groupInfo.name ) << "']\n";
}
virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {
}
virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE {
AssertionResult const& result = assertionStats.assertionResult;
if( !result.isOk() ) {
std::ostringstream msg;
if( !m_headerPrintedForThisSection )
printSectionHeader( msg );
m_headerPrintedForThisSection = true;
msg << result.getSourceInfo() << "\n";
switch( result.getResultType() ) {
case ResultWas::ExpressionFailed:
msg << "expression failed";
@@ -125,15 +125,15 @@ namespace Catch {
it != itEnd;
++it )
msg << "\n \"" << it->message << "\"";
if( result.hasExpression() ) {
msg <<
"\n " << result.getExpressionInMacro() << "\n"
"with expansion:\n" <<
" " << result.getExpandedExpression() << "\n";
}
stream << "##teamcity[testFailed"
<< " name='" << escape( currentTestCaseInfo->name )<< "'"
<< " message='" << escape( msg.str() ) << "'"
@@ -141,7 +141,7 @@ namespace Catch {
}
return true;
}
virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE {
m_headerPrintedForThisSection = false;
StreamingReporterBase::sectionStarting( sectionInfo );
@@ -152,7 +152,7 @@ namespace Catch {
stream << "##teamcity[testStarted name='"
<< escape( testInfo.name ) << "']\n";
}
virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE {
StreamingReporterBase::testCaseEnded( testCaseStats );
if( !testCaseStats.stdOut.empty() )
@@ -181,9 +181,9 @@ namespace Catch {
printHeaderString( os, it->name );
os << getLineOfChars<'-'>() << "\n";
}
SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
if( !lineInfo.empty() )
os << lineInfo << "\n";
os << getLineOfChars<'.'>() << "\n\n";
@@ -203,15 +203,15 @@ namespace Catch {
}
private:
bool m_headerPrintedForThisSection;
};
#ifdef CATCH_IMPL
TeamCityReporter::~TeamCityReporter() {}
#endif
INTERNAL_CATCH_REGISTER_REPORTER( "teamcity", TeamCityReporter )
} // end namespace Catch
#ifdef __clang__

View File

@@ -26,7 +26,7 @@ namespace Catch {
}
virtual ~XmlReporter() CATCH_OVERRIDE;
static std::string getDescription() {
return "Reports test results as an XML document";
}
@@ -72,7 +72,7 @@ namespace Catch {
virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE {
const AssertionResult& assertionResult = assertionStats.assertionResult;
// Print any info messages in <Info> tags.
if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) {
for( std::vector<MessageInfo>::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end();
@@ -134,10 +134,10 @@ namespace Catch {
default:
break;
}
if( assertionResult.hasExpression() )
m_xml.endElement();
return true;
}
@@ -176,7 +176,7 @@ namespace Catch {
.writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
m_xml.endElement();
}
virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE {
StreamingReporterBase::testRunEnded( testRunStats );
m_xml.scopedElement( "OverallResults" )