summaryrefslogtreecommitdiffstats
path: root/googlemock/src
diff options
context:
space:
mode:
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 {
OpenPOWER on IntegriCloud