Changed "const X ref"s to "X const ref"s

- Brought older code up to current convention (with the help of a Python script)
This commit is contained in:
Phil Nash 2013-04-23 18:58:56 +01:00
parent d0d4d93a6b
commit 2a9d8d9e36
44 changed files with 297 additions and 297 deletions

View file

@ -16,10 +16,10 @@
namespace Catch {
TestCase makeTestCase( ITestCase* _testCase,
const std::string& _className,
const std::string& _name,
const std::string& _descOrTags,
const SourceLineInfo& _lineInfo )
std::string const& _className,
std::string const& _name,
std::string const& _descOrTags,
SourceLineInfo const& _lineInfo )
{
std::string desc = _descOrTags;
bool isHidden( startsWith( _name, "./" ) );
@ -32,12 +32,12 @@ namespace Catch {
return TestCase( _testCase, info );
}
TestCaseInfo::TestCaseInfo( const std::string& _name,
const std::string& _className,
const std::string& _description,
const std::set<std::string>& _tags,
TestCaseInfo::TestCaseInfo( std::string const& _name,
std::string const& _className,
std::string const& _description,
std::set<std::string> const& _tags,
bool _isHidden,
const SourceLineInfo& _lineInfo )
SourceLineInfo const& _lineInfo )
: name( _name ),
className( _className ),
description( _description ),
@ -51,7 +51,7 @@ namespace Catch {
tagsAsString = oss.str();
}
TestCaseInfo::TestCaseInfo( const TestCaseInfo& other )
TestCaseInfo::TestCaseInfo( TestCaseInfo const& other )
: name( other.name ),
className( other.className ),
description( other.description ),
@ -61,14 +61,14 @@ namespace Catch {
isHidden( other.isHidden )
{}
TestCase::TestCase( ITestCase* testCase, const TestCaseInfo& info ) : TestCaseInfo( info ), test( testCase ) {}
TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
TestCase::TestCase( const TestCase& other )
TestCase::TestCase( TestCase const& other )
: TestCaseInfo( other ),
test( other.test )
{}
TestCase TestCase::withName( const std::string& _newName ) const {
TestCase TestCase::withName( std::string const& _newName ) const {
TestCase other( *this );
other.name = _newName;
return other;
@ -82,15 +82,15 @@ namespace Catch {
return TestCaseInfo::isHidden;
}
bool TestCase::hasTag( const std::string& tag ) const {
bool TestCase::hasTag( std::string const& tag ) const {
return tags.find( toLower( tag ) ) != tags.end();
}
bool TestCase::matchesTags( const std::string& tagPattern ) const {
bool TestCase::matchesTags( std::string const& tagPattern ) const {
TagExpression exp;
TagExpressionParser( exp ).parse( tagPattern );
return exp.matches( tags );
}
const std::set<std::string>& TestCase::getTags() const {
std::set<std::string> const& TestCase::getTags() const {
return tags;
}
@ -102,22 +102,22 @@ namespace Catch {
std::swap( lineInfo, other.lineInfo );
}
bool TestCase::operator == ( const TestCase& other ) const {
bool TestCase::operator == ( TestCase const& other ) const {
return test.get() == other.test.get() &&
name == other.name &&
className == other.className;
}
bool TestCase::operator < ( const TestCase& other ) const {
bool TestCase::operator < ( TestCase const& other ) const {
return name < other.name;
}
TestCase& TestCase::operator = ( const TestCase& other ) {
TestCase& TestCase::operator = ( TestCase const& other ) {
TestCase temp( other );
swap( temp );
return *this;
}
const TestCaseInfo& TestCase::getTestCaseInfo() const
TestCaseInfo const& TestCase::getTestCaseInfo() const
{
return *this;
}