summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2013-04-04 22:44:57 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2013-04-04 22:44:57 +0000
commitf2ac1ec8018f164081b8c002bcfbd88a4b52f65e (patch)
tree3ae3effb1cd991d106b0986fa36e21075c11de36
parente1a9187773939f142051d6f155822aa752db88c5 (diff)
downloadgtest-f2ac1ec8018f164081b8c002bcfbd88a4b52f65e.tar.gz
gtest-f2ac1ec8018f164081b8c002bcfbd88a4b52f65e.tar.bz2
gtest-f2ac1ec8018f164081b8c002bcfbd88a4b52f65e.tar.xz
Fixes some compatibility issues with STLport.
git-svn-id: http://googletest.googlecode.com/svn/trunk@647 861a406c-534a-0410-8894-cb66d6ee9925
-rw-r--r--test/gtest-printers_test.cc13
-rw-r--r--test/gtest_unittest.cc2
2 files changed, 10 insertions, 5 deletions
diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc
index 45610f8..c2beca7 100644
--- a/test/gtest-printers_test.cc
+++ b/test/gtest-printers_test.cc
@@ -214,10 +214,15 @@ using ::std::tr1::make_tuple;
using ::std::tr1::tuple;
#endif
-#if _MSC_VER
-// MSVC defines the following classes in the ::stdext namespace while
-// gcc defines them in the :: namespace. Note that they are not part
-// of the C++ standard.
+// The hash_* classes are not part of the C++ standard. STLport
+// defines them in namespace std. MSVC defines them in ::stdext. GCC
+// defines them in ::.
+#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
+using ::std::hash_map;
+using ::std::hash_set;
+using ::std::hash_multimap;
+using ::std::hash_multiset;
+#elif _MSC_VER
using ::stdext::hash_map;
using ::stdext::hash_set;
using ::stdext::hash_multimap;
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
index 769b75c..09ee898 100644
--- a/test/gtest_unittest.cc
+++ b/test/gtest_unittest.cc
@@ -4518,7 +4518,7 @@ TEST(EqAssertionTest, StdString) {
// Compares a const char* to an std::string that has different
// content
EXPECT_NONFATAL_FAILURE(EXPECT_EQ("Test", ::std::string("test")),
- "::std::string(\"test\")");
+ "\"test\"");
// Compares an std::string to a char* that has different content.
char* const p1 = const_cast<char*>("foo");