@@ -17,20 +17,20 @@ namespace Catch {
1717 public:
1818 Command (){}
1919
20- explicit Command ( const std::string& name ) : m_name( name ) {
20+ explicit Command ( std::string const & name ) : m_name( name ) {
2121 }
2222
23- Command& operator += ( const std::string& arg ) {
23+ Command& operator += ( std::string const & arg ) {
2424 m_args.push_back ( arg );
2525 return *this ;
2626 }
27- Command& operator += ( const Command& other ) {
27+ Command& operator += ( Command const & other ) {
2828 std::copy ( other.m_args .begin (), other.m_args .end (), std::back_inserter ( m_args ) );
2929 if ( m_name.empty () )
3030 m_name = other.m_name ;
3131 return *this ;
3232 }
33- Command operator + ( const Command& other ) {
33+ Command operator + ( Command const & other ) {
3434 Command newCommand ( *this );
3535 newCommand += other;
3636 return newCommand;
@@ -45,7 +45,7 @@ namespace Catch {
4545 std::size_t argsCount () const { return m_args.size (); }
4646
4747 CATCH_ATTRIBUTE_NORETURN
48- void raiseError ( const std::string& message ) const {
48+ void raiseError ( std::string const & message ) const {
4949 std::ostringstream oss;
5050 if ( m_name.empty () )
5151 oss << " Error while parsing " << m_name << " . " << message << " ." ;
@@ -76,14 +76,14 @@ namespace Catch {
7676 exeName = exeName.substr ( pos+1 );
7777 return exeName;
7878 }
79- Command find ( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const {
79+ Command find ( std::string const & arg1, std::string const & arg2, std::string const & arg3 ) const {
8080 return find ( arg1 ) + find ( arg2 ) + find ( arg3 );
8181 }
8282
83- Command find ( const std::string& shortArg, const std::string& longArg ) const {
83+ Command find ( std::string const & shortArg, std::string const & longArg ) const {
8484 return find ( shortArg ) + find ( longArg );
8585 }
86- Command find ( const std::string& arg ) const {
86+ Command find ( std::string const & arg ) const {
8787 if ( arg.empty () )
8888 return getArgs ( " " , 1 );
8989 else
@@ -97,7 +97,7 @@ namespace Catch {
9797 }
9898
9999 private:
100- Command getArgs ( const std::string& cmdName, std::size_t from ) const {
100+ Command getArgs ( std::string const & cmdName, std::size_t from ) const {
101101 Command command ( cmdName );
102102 for ( std::size_t i = from; i < m_argc && m_argv[i][0 ] != ' -' ; ++i )
103103 command += m_argv[i];
@@ -116,7 +116,7 @@ namespace Catch {
116116
117117 virtual ~OptionParser () {}
118118
119- Command find ( const CommandParser& parser ) const {
119+ Command find ( CommandParser const & parser ) const {
120120 Command cmd;
121121 for ( std::vector<std::string>::const_iterator it = m_optionNames.begin ();
122122 it != m_optionNames.end ();
@@ -125,7 +125,7 @@ namespace Catch {
125125 return cmd;
126126 }
127127
128- void validateArgs ( const Command& args ) const {
128+ void validateArgs ( Command const & args ) const {
129129 if ( tooFewArgs ( args ) || tooManyArgs ( args ) ) {
130130 std::ostringstream oss;
131131 if ( m_maxArgs == -1 )
@@ -138,14 +138,14 @@ namespace Catch {
138138 }
139139 }
140140
141- void parseIntoConfig ( const CommandParser& parser, ConfigData& config ) {
141+ void parseIntoConfig ( CommandParser const & parser, ConfigData& config ) {
142142 if ( Command cmd = find ( parser ) ) {
143143 validateArgs ( cmd );
144144 parseIntoConfig ( cmd, config );
145145 }
146146 }
147147
148- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) = 0;
148+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) = 0;
149149 virtual std::string argsSynopsis () const = 0;
150150 virtual std::string optionSummary () const = 0;
151151 virtual std::string optionDescription () const { return " " ; }
@@ -171,10 +171,10 @@ namespace Catch {
171171
172172 protected:
173173
174- bool tooFewArgs ( const Command& args ) const {
174+ bool tooFewArgs ( Command const & args ) const {
175175 return args.argsCount () < static_cast <std::size_t >( m_minArgs );
176176 }
177- bool tooManyArgs ( const Command& args ) const {
177+ bool tooManyArgs ( Command const & args ) const {
178178 return m_maxArgs >= 0 && args.argsCount () > static_cast <std::size_t >( m_maxArgs );
179179 }
180180 std::vector<std::string> m_optionNames;
@@ -201,7 +201,7 @@ namespace Catch {
201201 return " " ;
202202 }
203203
204- virtual void parseIntoConfig ( const Command&, ConfigData& ) {
204+ virtual void parseIntoConfig ( Command const &, ConfigData& ) {
205205 // Does not affect config
206206 }
207207 };
@@ -254,7 +254,7 @@ namespace Catch {
254254 " that start with 'a/b/', except 'a/b/c', which is included" ;
255255 }
256256
257- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
257+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
258258 std::string groupName;
259259 for ( std::size_t i = 0 ; i < cmd.argsCount (); ++i ) {
260260 if ( i != 0 )
@@ -300,7 +300,7 @@ namespace Catch {
300300 " matches all tests tagged [one], except those also tagged [two]" ;
301301 }
302302
303- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
303+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
304304 std::string groupName;
305305 for ( std::size_t i = 0 ; i < cmd.argsCount (); ++i ) {
306306 if ( i != 0 )
@@ -345,7 +345,7 @@ namespace Catch {
345345 ;// " -l xml";
346346 }
347347
348- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
348+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
349349 config.listSpec = List::Tests;
350350 if ( cmd.argsCount () >= 1 ) {
351351 if ( cmd[0 ] == " all" )
@@ -404,7 +404,7 @@ namespace Catch {
404404 " of the root node." ;
405405 }
406406
407- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
407+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
408408 config.reporter = cmd[0 ];
409409 }
410410 };
@@ -438,7 +438,7 @@ namespace Catch {
438438 " -o %debug \t (The IDE's debug output window - currently only Windows' "
439439 " OutputDebugString is supported)." ;
440440 }
441- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
441+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
442442 if ( cmd[0 ][0 ] == ' %' )
443443 config.stream = cmd[0 ].substr ( 1 );
444444 else
@@ -465,7 +465,7 @@ namespace Catch {
465465 " added worked first time!). To see successful, as well as failing, test results "
466466 " just pass this option." ;
467467 }
468- virtual void parseIntoConfig ( const Command&, ConfigData& config ) {
468+ virtual void parseIntoConfig ( Command const &, ConfigData& config ) {
469469 config.includeWhichResults = Include::SuccessfulResults;
470470 }
471471 };
@@ -491,7 +491,7 @@ namespace Catch {
491491 " built your code with the DEBUG preprocessor symbol" ;
492492 }
493493
494- virtual void parseIntoConfig ( const Command&, ConfigData& config ) {
494+ virtual void parseIntoConfig ( Command const &, ConfigData& config ) {
495495 config.shouldDebugBreak = true ;
496496 }
497497 };
@@ -521,7 +521,7 @@ namespace Catch {
521521 " -n \" tests of the widget component\" " ;
522522 }
523523
524- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
524+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
525525 config.name = cmd[0 ];
526526 }
527527 };
@@ -550,7 +550,7 @@ namespace Catch {
550550 " number causes it to abort after that number of assertion failures." ;
551551 }
552552
553- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
553+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
554554 int threshold = 1 ;
555555 if ( cmd.argsCount () == 1 ) {
556556 std::stringstream ss;
@@ -589,7 +589,7 @@ namespace Catch {
589589 " as not to contribute additional noise." ;
590590 }
591591
592- virtual void parseIntoConfig ( const Command&, ConfigData& config ) {
592+ virtual void parseIntoConfig ( Command const &, ConfigData& config ) {
593593 config.allowThrows = false ;
594594 }
595595 };
@@ -620,7 +620,7 @@ namespace Catch {
620620 " -w NoAssertions" ;
621621 }
622622
623- virtual void parseIntoConfig ( const Command& cmd, ConfigData& config ) {
623+ virtual void parseIntoConfig ( Command const & cmd, ConfigData& config ) {
624624 for ( std::size_t i = 0 ; i < cmd.argsCount (); ++i ) {
625625 if ( cmd[i] == " NoAssertions" )
626626 config.warnings = (ConfigData::WarnAbout::What)( config.warnings | ConfigData::WarnAbout::NoAssertions );
@@ -655,7 +655,7 @@ namespace Catch {
655655 add<Options::HelpOptionParser>(); // Keep this one last
656656 }
657657
658- void parseIntoConfig ( const CommandParser& parser, ConfigData& config ) {
658+ void parseIntoConfig ( CommandParser const & parser, ConfigData& config ) {
659659 config.name = parser.exeName ();
660660 if ( endsWith ( config.name , " .exe" ) )
661661 config.name = config.name .substr ( 0 , config.name .size ()-4 );
0 commit comments