Permalink
Browse files

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

- Brought older code up to current convention (with the help of a Python script)
  • Loading branch information...
philsquared committed Apr 23, 2013
1 parent d0d4d93 commit 2a9d8d9e368a8da58733df6746baff4bb76312d2
Showing with 297 additions and 297 deletions.
  1. +6 −6 include/internal/catch_approx.hpp
  2. +4 −4 include/internal/catch_assertionresult.h
  3. +4 −4 include/internal/catch_assertionresult.hpp
  4. +7 −7 include/internal/catch_capture.hpp
  5. +28 −28 include/internal/catch_commandline.hpp
  6. +12 −12 include/internal/catch_common.h
  7. +8 −8 include/internal/catch_config.hpp
  8. +2 −2 include/internal/catch_context.h
  9. +4 −4 include/internal/catch_context_impl.hpp
  10. +2 −2 include/internal/catch_debugger.hpp
  11. +9 −9 include/internal/catch_evaluate.hpp
  12. +2 −2 include/internal/catch_expression_decomposer.hpp
  13. +12 −12 include/internal/catch_expression_lhs.hpp
  14. +8 −8 include/internal/catch_expressionresult_builder.h
  15. +7 −7 include/internal/catch_expressionresult_builder.hpp
  16. +1 −1 include/internal/catch_generators_impl.hpp
  17. +1 −1 include/internal/catch_interfaces_capture.h
  18. +1 −1 include/internal/catch_interfaces_generators.h
  19. +4 −4 include/internal/catch_interfaces_registry_hub.h
  20. +3 −3 include/internal/catch_interfaces_reporter.h
  21. +2 −2 include/internal/catch_interfaces_testcase.h
  22. +5 −5 include/internal/catch_list.hpp
  23. +34 −34 include/internal/catch_matchers.hpp
  24. +1 −1 include/internal/catch_notimplemented_exception.h
  25. +1 −1 include/internal/catch_notimplemented_exception.hpp
  26. +3 −3 include/internal/catch_objc.hpp
  27. +1 −1 include/internal/catch_option.hpp
  28. +6 −6 include/internal/catch_registry_hub.hpp
  29. +4 −4 include/internal/catch_reporter_registrars.hpp
  30. +3 −3 include/internal/catch_reporter_registry.hpp
  31. +11 −11 include/internal/catch_runner_impl.hpp
  32. +5 −5 include/internal/catch_running_test.hpp
  33. +3 −3 include/internal/catch_section.hpp
  34. +3 −3 include/internal/catch_section_info.hpp
  35. +1 −1 include/internal/catch_stream.hpp
  36. +10 −10 include/internal/catch_tags.hpp
  37. +20 −20 include/internal/catch_test_case_info.h
  38. +20 −20 include/internal/catch_test_case_info.hpp
  39. +8 −8 include/internal/catch_test_case_registry_impl.hpp
  40. +2 −2 include/internal/catch_test_registry.hpp
  41. +7 −7 include/internal/catch_test_spec.h
  42. +5 −5 include/internal/catch_tostring.hpp
  43. +5 −5 include/internal/catch_totals.hpp
  44. +12 −12 include/internal/catch_xmlwriter.hpp
@@ -24,7 +24,7 @@ namespace Detail {
m_value( value )
{}
Approx( const Approx& other )
Approx( Approx const& other )
: m_epsilon( other.m_epsilon ),
m_scale( other.m_scale ),
m_value( other.m_value )
@@ -41,20 +41,20 @@ namespace Detail {
return approx;
}
friend bool operator == ( double lhs, const Approx& rhs ) {
friend bool operator == ( double lhs, Approx const& rhs ) {
// Thanks to Richard Harris for his help refining this formula
return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) );
}
friend bool operator == ( const Approx& lhs, double rhs ) {
friend bool operator == ( Approx const& lhs, double rhs ) {
return operator==( rhs, lhs );
}
friend bool operator != ( double lhs, const Approx& rhs ) {
friend bool operator != ( double lhs, Approx const& rhs ) {
return !operator==( lhs, rhs );
}
friend bool operator != ( const Approx& lhs, double rhs ) {
friend bool operator != ( Approx const& lhs, double rhs ) {
return !operator==( rhs, lhs );
}
@@ -82,7 +82,7 @@ namespace Detail {
}
template<>
inline std::string toString<Detail::Approx>( const Detail::Approx& value ) {
inline std::string toString<Detail::Approx>( Detail::Approx const& value ) {
return value.toString();
}
@@ -16,9 +16,9 @@ namespace Catch {
struct AssertionInfo
{
AssertionInfo() {}
AssertionInfo( const std::string& _macroName,
const SourceLineInfo& _lineInfo,
const std::string& _capturedExpression,
AssertionInfo( std::string const& _macroName,
SourceLineInfo const& _lineInfo,
std::string const& _capturedExpression,
ResultDisposition::Flags _resultDisposition );
std::string macroName;
@@ -39,7 +39,7 @@ namespace Catch {
class AssertionResult {
public:
AssertionResult();
AssertionResult( const AssertionInfo& info, const AssertionResultData& data );
AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
~AssertionResult();
bool isOk() const;
@@ -13,9 +13,9 @@
namespace Catch {
AssertionInfo::AssertionInfo( const std::string& _macroName,
const SourceLineInfo& _lineInfo,
const std::string& _capturedExpression,
AssertionInfo::AssertionInfo( std::string const& _macroName,
SourceLineInfo const& _lineInfo,
std::string const& _capturedExpression,
ResultDisposition::Flags _resultDisposition )
: macroName( _macroName ),
lineInfo( _lineInfo ),
@@ -28,7 +28,7 @@ namespace Catch {
AssertionResult::AssertionResult() {}
AssertionResult::AssertionResult( const AssertionInfo& info, const AssertionResultData& data )
AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
: m_info( info ),
m_resultData( data )
{}
@@ -27,8 +27,8 @@ namespace Catch {
}
template<typename MatcherT>
ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher,
const std::string& matcherCallAsString ) {
ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher,
std::string const& matcherCallAsString ) {
std::string matcherAsString = matcher.toString();
if( matcherAsString == "{?}" )
matcherAsString = matcherCallAsString;
@@ -38,18 +38,18 @@ namespace Catch {
}
template<typename MatcherT, typename ArgT>
ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher,
const ArgT& arg,
const std::string& matcherCallAsString ) {
ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher,
ArgT const& arg,
std::string const& matcherCallAsString ) {
return expressionResultBuilderFromMatcher( matcher, matcherCallAsString )
.setLhs( Catch::toString( arg ) )
.setResultType( matcher.match( arg ) );
}
template<typename MatcherT, typename ArgT>
ExpressionResultBuilder expressionResultBuilderFromMatcher( const MatcherT& matcher,
ExpressionResultBuilder expressionResultBuilderFromMatcher( MatcherT const& matcher,
ArgT* arg,
const std::string& matcherCallAsString ) {
std::string const& matcherCallAsString ) {
return expressionResultBuilderFromMatcher( matcher, matcherCallAsString )
.setLhs( Catch::toString( arg ) )
.setResultType( matcher.match( arg ) );
@@ -17,20 +17,20 @@ namespace Catch {
public:
Command(){}
explicit Command( const std::string& name ) : m_name( name ) {
explicit Command( std::string const& name ) : m_name( name ) {
}
Command& operator += ( const std::string& arg ) {
Command& operator += ( std::string const& arg ) {
m_args.push_back( arg );
return *this;
}
Command& operator += ( const Command& other ) {
Command& operator += ( Command const& other ) {
std::copy( other.m_args.begin(), other.m_args.end(), std::back_inserter( m_args ) );
if( m_name.empty() )
m_name = other.m_name;
return *this;
}
Command operator + ( const Command& other ) {
Command operator + ( Command const& other ) {
Command newCommand( *this );
newCommand += other;
return newCommand;
@@ -45,7 +45,7 @@ namespace Catch {
std::size_t argsCount() const { return m_args.size(); }
CATCH_ATTRIBUTE_NORETURN
void raiseError( const std::string& message ) const {
void raiseError( std::string const& message ) const {
std::ostringstream oss;
if( m_name.empty() )
oss << "Error while parsing " << m_name << ". " << message << ".";
@@ -76,14 +76,14 @@ namespace Catch {
exeName = exeName.substr( pos+1 );
return exeName;
}
Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const {
Command find( std::string const& arg1, std::string const& arg2, std::string const& arg3 ) const {
return find( arg1 ) + find( arg2 ) + find( arg3 );
}
Command find( const std::string& shortArg, const std::string& longArg ) const {
Command find( std::string const& shortArg, std::string const& longArg ) const {
return find( shortArg ) + find( longArg );
}
Command find( const std::string& arg ) const {
Command find( std::string const& arg ) const {
if( arg.empty() )
return getArgs( "", 1 );
else
@@ -97,7 +97,7 @@ namespace Catch {
}
private:
Command getArgs( const std::string& cmdName, std::size_t from ) const {
Command getArgs( std::string const& cmdName, std::size_t from ) const {
Command command( cmdName );
for( std::size_t i = from; i < m_argc && m_argv[i][0] != '-'; ++i )
command += m_argv[i];
@@ -116,7 +116,7 @@ namespace Catch {
virtual ~OptionParser() {}
Command find( const CommandParser& parser ) const {
Command find( CommandParser const& parser ) const {
Command cmd;
for( std::vector<std::string>::const_iterator it = m_optionNames.begin();
it != m_optionNames.end();
@@ -125,7 +125,7 @@ namespace Catch {
return cmd;
}
void validateArgs( const Command& args ) const {
void validateArgs( Command const& args ) const {
if( tooFewArgs( args ) || tooManyArgs( args ) ) {
std::ostringstream oss;
if( m_maxArgs == -1 )
@@ -138,14 +138,14 @@ namespace Catch {
}
}
void parseIntoConfig( const CommandParser& parser, ConfigData& config ) {
void parseIntoConfig( CommandParser const& parser, ConfigData& config ) {
if( Command cmd = find( parser ) ) {
validateArgs( cmd );
parseIntoConfig( cmd, config );
}
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) = 0;
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) = 0;
virtual std::string argsSynopsis() const = 0;
virtual std::string optionSummary() const = 0;
virtual std::string optionDescription() const { return ""; }
@@ -171,10 +171,10 @@ namespace Catch {
protected:
bool tooFewArgs( const Command& args ) const {
bool tooFewArgs( Command const& args ) const {
return args.argsCount() < static_cast<std::size_t>( m_minArgs );
}
bool tooManyArgs( const Command& args ) const {
bool tooManyArgs( Command const& args ) const {
return m_maxArgs >= 0 && args.argsCount() > static_cast<std::size_t>( m_maxArgs );
}
std::vector<std::string> m_optionNames;
@@ -201,7 +201,7 @@ namespace Catch {
return "";
}
virtual void parseIntoConfig( const Command&, ConfigData& ) {
virtual void parseIntoConfig( Command const&, ConfigData& ) {
// Does not affect config
}
};
@@ -254,7 +254,7 @@ namespace Catch {
"that start with 'a/b/', except 'a/b/c', which is included";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
std::string groupName;
for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
if( i != 0 )
@@ -300,7 +300,7 @@ namespace Catch {
"matches all tests tagged [one], except those also tagged [two]";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
std::string groupName;
for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
if( i != 0 )
@@ -345,7 +345,7 @@ namespace Catch {
;//" -l xml";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
config.listSpec = List::Tests;
if( cmd.argsCount() >= 1 ) {
if( cmd[0] == "all" )
@@ -404,7 +404,7 @@ namespace Catch {
"of the root node.";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
config.reporter = cmd[0];
}
};
@@ -438,7 +438,7 @@ namespace Catch {
" -o %debug \t(The IDE's debug output window - currently only Windows' "
"OutputDebugString is supported).";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
if( cmd[0][0] == '%' )
config.stream = cmd[0].substr( 1 );
else
@@ -465,7 +465,7 @@ namespace Catch {
"added worked first time!). To see successful, as well as failing, test results "
"just pass this option.";
}
virtual void parseIntoConfig( const Command&, ConfigData& config ) {
virtual void parseIntoConfig( Command const&, ConfigData& config ) {
config.includeWhichResults = Include::SuccessfulResults;
}
};
@@ -491,7 +491,7 @@ namespace Catch {
"built your code with the DEBUG preprocessor symbol";
}
virtual void parseIntoConfig( const Command&, ConfigData& config ) {
virtual void parseIntoConfig( Command const&, ConfigData& config ) {
config.shouldDebugBreak = true;
}
};
@@ -521,7 +521,7 @@ namespace Catch {
" -n \"tests of the widget component\"";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
config.name = cmd[0];
}
};
@@ -550,7 +550,7 @@ namespace Catch {
"number causes it to abort after that number of assertion failures.";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
int threshold = 1;
if( cmd.argsCount() == 1 ) {
std::stringstream ss;
@@ -589,7 +589,7 @@ namespace Catch {
"as not to contribute additional noise.";
}
virtual void parseIntoConfig( const Command&, ConfigData& config ) {
virtual void parseIntoConfig( Command const&, ConfigData& config ) {
config.allowThrows = false;
}
};
@@ -620,7 +620,7 @@ namespace Catch {
" -w NoAssertions";
}
virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) {
virtual void parseIntoConfig( Command const& cmd, ConfigData& config ) {
for( std::size_t i = 0; i < cmd.argsCount(); ++i ) {
if( cmd[i] == "NoAssertions" )
config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions );
@@ -655,7 +655,7 @@ namespace Catch {
add<Options::HelpOptionParser>(); // Keep this one last
}
void parseIntoConfig( const CommandParser& parser, ConfigData& config ) {
void parseIntoConfig( CommandParser const& parser, ConfigData& config ) {
config.name = parser.exeName();
if( endsWith( config.name, ".exe" ) )
config.name = config.name.substr( 0, config.name.size()-4 );
Oops, something went wrong.

0 comments on commit 2a9d8d9

Please sign in to comment.