Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Take std::string by const-ref where possible

Most places already do, this brings over some forgotten places.

Also close #842
Commit
e95bf48445f60e8cdb720962685d26476964cf22
Author
Martin Hořeňovský ·
Parents
932a405e1899

Files · Download .tar.gz

Changes

 include/internal/catch_matchers_string.h     | 2 +-
 include/internal/catch_matchers_string.hpp   | 2 +-
 include/internal/catch_tag_alias.h           | 2 +-
 include/reporters/catch_reporter_compact.hpp | 4 ++--
 include/reporters/catch_reporter_tap.hpp     | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/internal/catch_matchers_string.h b/include/internal/catch_matchers_string.h
index 2a6d3ba0..69dabcb5 100644
--- a/include/internal/catch_matchers_string.h
+++ b/include/internal/catch_matchers_string.h
@@ -26,7 +26,7 @@ namespace Matchers {
         };
 
         struct StringMatcherBase : MatcherBase<std::string> {
-            StringMatcherBase( std::string operation, CasedString const& comparator );
+            StringMatcherBase( std::string const& operation, CasedString const& comparator );
             virtual std::string describe() const CATCH_OVERRIDE;
 
             CasedString m_comparator;
diff --git a/include/internal/catch_matchers_string.hpp b/include/internal/catch_matchers_string.hpp
index 107d8e2d..ca117eda 100644
--- a/include/internal/catch_matchers_string.hpp
+++ b/include/internal/catch_matchers_string.hpp
@@ -29,7 +29,7 @@ namespace Matchers {
         }
 
 
-        StringMatcherBase::StringMatcherBase( std::string operation, CasedString const& comparator )
+        StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator )
         : m_comparator( comparator ),
           m_operation( operation ) {
         }
diff --git a/include/internal/catch_tag_alias.h b/include/internal/catch_tag_alias.h
index 6dde74ad..bb23bc8d 100644
--- a/include/internal/catch_tag_alias.h
+++ b/include/internal/catch_tag_alias.h
@@ -15,7 +15,7 @@
 namespace Catch {
 
     struct TagAlias {
-        TagAlias( std::string _tag, SourceLineInfo _lineInfo ) : tag( _tag ), lineInfo( _lineInfo ) {}
+        TagAlias( std::string const& _tag, SourceLineInfo _lineInfo ) : tag( _tag ), lineInfo( _lineInfo ) {}
 
         std::string tag;
         SourceLineInfo lineInfo;
diff --git a/include/reporters/catch_reporter_compact.hpp b/include/reporters/catch_reporter_compact.hpp
index 11e3b7c6..8d6f9085 100644
--- a/include/reporters/catch_reporter_compact.hpp
+++ b/include/reporters/catch_reporter_compact.hpp
@@ -169,7 +169,7 @@ namespace Catch {
                 stream << result.getSourceInfo() << ':';
             }
 
-            void printResultType( Colour::Code colour, std::string passOrFail ) const {
+            void printResultType( Colour::Code colour, std::string const& passOrFail ) const {
                 if( !passOrFail.empty() ) {
                     {
                         Colour colourGuard( colour );
@@ -179,7 +179,7 @@ namespace Catch {
                 }
             }
 
-            void printIssue( std::string issue ) const {
+            void printIssue( std::string const& issue ) const {
                 stream << ' ' << issue;
             }
 
diff --git a/include/reporters/catch_reporter_tap.hpp b/include/reporters/catch_reporter_tap.hpp
index d2eeb3cd..8f8896a6 100644
--- a/include/reporters/catch_reporter_tap.hpp
+++ b/include/reporters/catch_reporter_tap.hpp
@@ -157,13 +157,13 @@ namespace Catch {
                 stream << result.getSourceInfo() << ":";
             }
 
-            void printResultType( std::string passOrFail ) const {
+            void printResultType( std::string const& passOrFail ) const {
                 if( !passOrFail.empty() ) {
                     stream << passOrFail << ' ' << counter << " -";
                 }
             }
 
-            void printIssue( std::string issue ) const {
+            void printIssue( std::string const& issue ) const {
                 stream << " " << issue;
             }