aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/src
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-03-26 11:19:10 -0400
committerGitHub <noreply@github.com>2018-03-26 11:19:10 -0400
commit78579756a80619ae06e8850796ed95bc6043a92d (patch)
tree3341a813e84dfb87275aa8d24084da410353f42c /googlemock/src
parentdfa853b63d17c787914b663b50c2095a0c5b706e (diff)
parent6aae206bc2970068cf6bbf72a9ad07f8464cd0d0 (diff)
downloadgoogletest-78579756a80619ae06e8850796ed95bc6043a92d.tar.gz
googletest-78579756a80619ae06e8850796ed95bc6043a92d.tar.bz2
googletest-78579756a80619ae06e8850796ed95bc6043a92d.zip
Merge pull request #1512 from gennadiycivil/master
merges, gmock - 1
Diffstat (limited to 'googlemock/src')
-rw-r--r--googlemock/src/gmock-matchers.cc77
1 files changed, 42 insertions, 35 deletions
diff --git a/googlemock/src/gmock-matchers.cc b/googlemock/src/gmock-matchers.cc
index 88e40088..a5ed686e 100644
--- a/googlemock/src/gmock-matchers.cc
+++ b/googlemock/src/gmock-matchers.cc
@@ -44,60 +44,67 @@
namespace testing {
-// Constructs a matcher that matches a const string& whose value is
+// Constructs a matcher that matches a const std::string& whose value is
// equal to s.
-Matcher<const internal::string&>::Matcher(const internal::string& s) {
- *this = Eq(s);
+Matcher<const std::string&>::Matcher(const std::string& s) { *this = Eq(s); }
+
+#if GTEST_HAS_GLOBAL_STRING
+// Constructs a matcher that matches a const std::string& whose value is
+// equal to s.
+Matcher<const std::string&>::Matcher(const ::string& s) {
+ *this = Eq(static_cast<std::string>(s));
}
+#endif // GTEST_HAS_GLOBAL_STRING
-// Constructs a matcher that matches a const string& whose value is
+// Constructs a matcher that matches a const std::string& whose value is
// equal to s.
-Matcher<const internal::string&>::Matcher(const char* s) {
- *this = Eq(internal::string(s));
+Matcher<const std::string&>::Matcher(const char* s) {
+ *this = Eq(std::string(s));
}
-// Constructs a matcher that matches a string whose value is equal to s.
-Matcher<internal::string>::Matcher(const internal::string& s) { *this = Eq(s); }
+// Constructs a matcher that matches a std::string whose value is equal to
+// s.
+Matcher<std::string>::Matcher(const std::string& s) { *this = Eq(s); }
-// Constructs a matcher that matches a string whose value is equal to s.
-Matcher<internal::string>::Matcher(const char* s) {
- *this = Eq(internal::string(s));
+#if GTEST_HAS_GLOBAL_STRING
+// Constructs a matcher that matches a std::string whose value is equal to
+// s.
+Matcher<std::string>::Matcher(const ::string& s) {
+ *this = Eq(static_cast<std::string>(s));
}
+#endif // GTEST_HAS_GLOBAL_STRING
+
+// Constructs a matcher that matches a std::string whose value is equal to
+// s.
+Matcher<std::string>::Matcher(const char* s) { *this = Eq(std::string(s)); }
-#if GTEST_HAS_STRING_PIECE_
-// Constructs a matcher that matches a const StringPiece& whose value is
+#if GTEST_HAS_GLOBAL_STRING
+// Constructs a matcher that matches a const ::string& whose value is
// equal to s.
-Matcher<const StringPiece&>::Matcher(const internal::string& s) {
- *this = Eq(s);
+Matcher<const ::string&>::Matcher(const std::string& s) {
+ *this = Eq(static_cast<::string>(s));
}
-// Constructs a matcher that matches a const StringPiece& whose value is
+// Constructs a matcher that matches a const ::string& whose value is
// equal to s.
-Matcher<const StringPiece&>::Matcher(const char* s) {
- *this = Eq(internal::string(s));
-}
+Matcher<const ::string&>::Matcher(const ::string& s) { *this = Eq(s); }
-// Constructs a matcher that matches a const StringPiece& whose value is
+// Constructs a matcher that matches a const ::string& whose value is
// equal to s.
-Matcher<const StringPiece&>::Matcher(StringPiece s) {
- *this = Eq(s.ToString());
-}
+Matcher<const ::string&>::Matcher(const char* s) { *this = Eq(::string(s)); }
-// Constructs a matcher that matches a StringPiece whose value is equal to s.
-Matcher<StringPiece>::Matcher(const internal::string& s) {
- *this = Eq(s);
+// Constructs a matcher that matches a ::string whose value is equal to s.
+Matcher<::string>::Matcher(const std::string& s) {
+ *this = Eq(static_cast<::string>(s));
}
-// Constructs a matcher that matches a StringPiece whose value is equal to s.
-Matcher<StringPiece>::Matcher(const char* s) {
- *this = Eq(internal::string(s));
-}
+// Constructs a matcher that matches a ::string whose value is equal to s.
+Matcher<::string>::Matcher(const ::string& s) { *this = Eq(s); }
+
+// Constructs a matcher that matches a string whose value is equal to s.
+Matcher<::string>::Matcher(const char* s) { *this = Eq(::string(s)); }
+#endif // GTEST_HAS_GLOBAL_STRING
-// Constructs a matcher that matches a StringPiece whose value is equal to s.
-Matcher<StringPiece>::Matcher(StringPiece s) {
- *this = Eq(s.ToString());
-}
-#endif // GTEST_HAS_STRING_PIECE_
namespace internal {