From 39bf784f839a9ffeb5f2d943435783633c5c0a6d Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Wed, 16 Dec 2009 23:36:08 +0000 Subject: [PATCH] Removes uses of GTEST_HAS_STD_STRING. --- include/gmock/gmock-actions.h | 2 -- include/gmock/gmock-printers.h | 2 -- include/gmock/internal/gmock-port.h | 4 +--- src/gmock-printers.cc | 2 -- test/gmock-actions_test.cc | 4 ---- test/gmock-printers_test.cc | 2 -- 6 files changed, 1 insertion(+), 15 deletions(-) diff --git a/include/gmock/gmock-actions.h b/include/gmock/gmock-actions.h index 214b2912..d965e108 100644 --- a/include/gmock/gmock-actions.h +++ b/include/gmock/gmock-actions.h @@ -117,9 +117,7 @@ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT #if GTEST_HAS_GLOBAL_STRING GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::string, ""); #endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_STD_STRING GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, ""); -#endif // GTEST_HAS_STD_STRING GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0'); GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0'); diff --git a/include/gmock/gmock-printers.h b/include/gmock/gmock-printers.h index 9f024d0c..cda3545a 100644 --- a/include/gmock/gmock-printers.h +++ b/include/gmock/gmock-printers.h @@ -409,12 +409,10 @@ inline void PrintTo(const ::string& s, ::std::ostream* os) { } #endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_STD_STRING void PrintStringTo(const ::std::string&s, ::std::ostream* os); inline void PrintTo(const ::std::string& s, ::std::ostream* os) { PrintStringTo(s, os); } -#endif // GTEST_HAS_STD_STRING // Overloads for ::wstring and ::std::wstring. #if GTEST_HAS_GLOBAL_WSTRING diff --git a/include/gmock/internal/gmock-port.h b/include/gmock/internal/gmock-port.h index 649f838f..27b67a5c 100644 --- a/include/gmock/internal/gmock-port.h +++ b/include/gmock/internal/gmock-port.h @@ -198,10 +198,8 @@ struct CompileAssert { #if GTEST_HAS_GLOBAL_STRING typedef ::string string; -#elif GTEST_HAS_STD_STRING -typedef ::std::string string; #else -#error "Google Mock requires ::std::string to compile." +typedef ::std::string string; #endif // GTEST_HAS_GLOBAL_STRING #if GTEST_HAS_GLOBAL_WSTRING diff --git a/src/gmock-printers.cc b/src/gmock-printers.cc index 8efba782..fd7d3055 100644 --- a/src/gmock-printers.cc +++ b/src/gmock-printers.cc @@ -296,11 +296,9 @@ void PrintStringTo(const ::string& s, ostream* os) { } #endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_STD_STRING void PrintStringTo(const ::std::string& s, ostream* os) { PrintCharsAsStringTo(s.data(), s.size(), os); } -#endif // GTEST_HAS_STD_STRING // Prints a ::wstring object. #if GTEST_HAS_GLOBAL_WSTRING diff --git a/test/gmock-actions_test.cc b/test/gmock-actions_test.cc index 1be4a16c..ea3c3100 100644 --- a/test/gmock-actions_test.cc +++ b/test/gmock-actions_test.cc @@ -165,9 +165,7 @@ TEST(BuiltInDefaultValueTest, IsEmptyStringForString) { EXPECT_EQ("", BuiltInDefaultValue< ::string>::Get()); #endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_STD_STRING EXPECT_EQ("", BuiltInDefaultValue< ::std::string>::Get()); -#endif // GTEST_HAS_STD_STRING } // Tests that BuiltInDefaultValue::Exists() returns true when T is a @@ -177,9 +175,7 @@ TEST(BuiltInDefaultValueTest, ExistsForString) { EXPECT_TRUE(BuiltInDefaultValue< ::string>::Exists()); #endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_STD_STRING EXPECT_TRUE(BuiltInDefaultValue< ::std::string>::Exists()); -#endif // GTEST_HAS_STD_STRING } // Tests that BuiltInDefaultValue::Get() returns the same diff --git a/test/gmock-printers_test.cc b/test/gmock-printers_test.cc index e1956202..abfa923c 100644 --- a/test/gmock-printers_test.cc +++ b/test/gmock-printers_test.cc @@ -560,7 +560,6 @@ TEST(PrintStringTest, StringInGlobalNamespace) { } #endif // GTEST_HAS_GLOBAL_STRING -#if GTEST_HAS_STD_STRING // ::std::string. TEST(PrintStringTest, StringInStdNamespace) { const char s[] = "'\"\?\\\a\b\f\n\0\r\t\v\x7F\xFF a"; @@ -568,7 +567,6 @@ TEST(PrintStringTest, StringInStdNamespace) { EXPECT_EQ("\"'\\\"\\?\\\\\\a\\b\\f\\n\\0\\r\\t\\v\\x7F\\xFF a\\0\"", Print(str)); } -#endif // GTEST_HAS_STD_STRING // Tests printing ::wstring and ::std::wstring.