Fix whitespace errors in include/**

Two types of errors:

* Trailing whitespace.
* Empty line at the end of a file.

No functional changes.
This commit is contained in:
xaizek 2015-09-30 12:46:21 +03:00
parent d758428fe2
commit a0e64729f0
16 changed files with 49 additions and 52 deletions

View File

@ -62,7 +62,7 @@ namespace Catch {
} }
std::vector<TestCase> skippedTestCases; std::vector<TestCase> skippedTestCases;
getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, skippedTestCases, true ); getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, skippedTestCases, true );
for( std::vector<TestCase>::const_iterator it = skippedTestCases.begin(), itEnd = skippedTestCases.end(); for( std::vector<TestCase>::const_iterator it = skippedTestCases.begin(), itEnd = skippedTestCases.end();
it != itEnd; it != itEnd;
++it ) ++it )

View File

@ -158,7 +158,7 @@ namespace Catch {
.describe( "list all/matching test cases names only" ) .describe( "list all/matching test cases names only" )
.bind( &ConfigData::listTestNamesOnly ); .bind( &ConfigData::listTestNamesOnly );
cli["--list-reporters"] cli["--list-reporters"]
.describe( "list all reporters" ) .describe( "list all reporters" )
.bind( &ConfigData::listReporters ); .bind( &ConfigData::listReporters );

View File

@ -128,4 +128,3 @@ namespace Catch {
#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO ); #define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED #endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED

View File

@ -36,7 +36,7 @@ namespace Catch {
return start != std::string::npos ? str.substr( start, 1+end-start ) : ""; return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
} }
bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) { bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
bool replaced = false; bool replaced = false;
std::size_t i = str.find( replaceThis ); std::size_t i = str.find( replaceThis );
@ -50,7 +50,7 @@ namespace Catch {
} }
return replaced; return replaced;
} }
pluralise::pluralise( std::size_t count, std::string const& label ) pluralise::pluralise( std::size_t count, std::string const& label )
: m_count( count ), : m_count( count ),
m_label( label ) m_label( label )
@ -100,4 +100,3 @@ namespace Catch {
} }
#endif // TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED

View File

@ -164,4 +164,3 @@
#endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED

View File

@ -244,7 +244,7 @@ namespace Catch
virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
virtual void skipTest( TestCaseInfo const& testInfo ) = 0; virtual void skipTest( TestCaseInfo const& testInfo ) = 0;
}; };

View File

@ -80,7 +80,7 @@ namespace Catch {
std::string lhs, rhs, op; std::string lhs, rhs, op;
} m_exprComponents; } m_exprComponents;
CopyableStream m_stream; CopyableStream m_stream;
bool m_shouldDebugBreak; bool m_shouldDebugBreak;
bool m_shouldThrow; bool m_shouldThrow;
}; };

View File

@ -55,7 +55,7 @@ namespace Catch {
inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; } inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
} // end namespace Catch } // end namespace Catch
#endif // TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED #endif // TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED

View File

@ -31,7 +31,7 @@ namespace Catch {
MayFail = 1 << 3, MayFail = 1 << 3,
Throws = 1 << 4 Throws = 1 << 4
}; };
TestCaseInfo( std::string const& _name, TestCaseInfo( std::string const& _name,
std::string const& _className, std::string const& _className,
std::string const& _description, std::string const& _description,

View File

@ -83,7 +83,7 @@ namespace Catch {
private: private:
static void sortTests( IConfig const& config, std::vector<TestCase>& matchingTestCases ) { static void sortTests( IConfig const& config, std::vector<TestCase>& matchingTestCases ) {
switch( config.runOrder() ) { switch( config.runOrder() ) {
case RunTests::InLexicographicalOrder: case RunTests::InLexicographicalOrder:
std::sort( matchingTestCases.begin(), matchingTestCases.end(), LexSort() ); std::sort( matchingTestCases.begin(), matchingTestCases.end(), LexSort() );

View File

@ -16,9 +16,9 @@ namespace Catch {
namespace SectionTracking { namespace SectionTracking {
class TrackedSection { class TrackedSection {
typedef std::map<std::string, TrackedSection> TrackedSections; typedef std::map<std::string, TrackedSection> TrackedSections;
public: public:
enum RunState { enum RunState {
NotStarted, NotStarted,
@ -26,13 +26,13 @@ namespace SectionTracking {
ExecutingChildren, ExecutingChildren,
Completed Completed
}; };
TrackedSection( std::string const& name, TrackedSection* parent ) TrackedSection( std::string const& name, TrackedSection* parent )
: m_name( name ), m_runState( NotStarted ), m_parent( parent ) : m_name( name ), m_runState( NotStarted ), m_parent( parent )
{} {}
RunState runState() const { return m_runState; } RunState runState() const { return m_runState; }
TrackedSection* findChild( std::string const& childName ); TrackedSection* findChild( std::string const& childName );
TrackedSection* acquireChild( std::string const& childName ); TrackedSection* acquireChild( std::string const& childName );
@ -48,14 +48,14 @@ namespace SectionTracking {
bool hasChildren() const { bool hasChildren() const {
return !m_children.empty(); return !m_children.empty();
} }
private: private:
std::string m_name; std::string m_name;
RunState m_runState; RunState m_runState;
TrackedSections m_children; TrackedSections m_children;
TrackedSection* m_parent; TrackedSection* m_parent;
}; };
inline TrackedSection* TrackedSection::findChild( std::string const& childName ) { inline TrackedSection* TrackedSection::findChild( std::string const& childName ) {
TrackedSections::iterator it = m_children.find( childName ); TrackedSections::iterator it = m_children.find( childName );
return it != m_children.end() return it != m_children.end()

View File

@ -62,7 +62,7 @@ std::string toString( std::nullptr_t );
std::string toString( NSObject* const& nsObject ); std::string toString( NSObject* const& nsObject );
#endif #endif
namespace Detail { namespace Detail {
extern std::string unprintableString; extern std::string unprintableString;
@ -73,7 +73,7 @@ namespace Detail {
struct TrueType { char sizer[1]; }; struct TrueType { char sizer[1]; };
struct FalseType { char sizer[2]; }; struct FalseType { char sizer[2]; };
TrueType& testStreamable( std::ostream& ); TrueType& testStreamable( std::ostream& );
FalseType testStreamable( FalseType ); FalseType testStreamable( FalseType );

View File

@ -27,7 +27,7 @@ namespace Catch {
unsigned int const buildNumber; unsigned int const buildNumber;
friend std::ostream& operator << ( std::ostream& os, Version const& version ); friend std::ostream& operator << ( std::ostream& os, Version const& version );
private: private:
void operator=( Version const& ); void operator=( Version const& );
}; };

View File

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

View File

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

View File

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