diff options
author | Gennadiy Civil <misterg@google.com> | 2018-03-22 15:35:37 -0400 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-03-22 15:35:37 -0400 |
commit | b7c568326c969c59a5f90e4731dc5b91f260c6f0 (patch) | |
tree | 318623a0ae1ab868a757ac7ee9eb2e444ce8e798 /googlemock/src | |
parent | 4e89c76db83684d4c5b86eb9186af3e33f5f4df0 (diff) | |
download | googletest-b7c568326c969c59a5f90e4731dc5b91f260c6f0.tar.gz googletest-b7c568326c969c59a5f90e4731dc5b91f260c6f0.tar.bz2 googletest-b7c568326c969c59a5f90e4731dc5b91f260c6f0.zip |
merging, gmock -1
Diffstat (limited to 'googlemock/src')
-rw-r--r-- | googlemock/src/gmock-matchers.cc | 77 |
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 { |