Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorMartin Hořeňovský2017-03-06 13:16:43 +0100
committerMartin Hořeňovský2017-03-06 13:16:43 +0100
commite95bf48445f60e8cdb720962685d26476964cf22 (patch)
tree9ed6ef1e08320a58b98aa1c9f44f0178eb71594b /include
parent932a405e1899a6d8e5b8322d0043a90218dca402 (diff)
downloadcatch3-e95bf48445f60e8cdb720962685d26476964cf22.tar.gz
Take std::string by const-ref where possible
Most places already do, this brings over some forgotten places. Also close #842
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_matchers_string.h2
-rw-r--r--include/internal/catch_matchers_string.hpp2
-rw-r--r--include/internal/catch_tag_alias.h2
-rw-r--r--include/reporters/catch_reporter_compact.hpp4
-rw-r--r--include/reporters/catch_reporter_tap.hpp4
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;
}