summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-04-12 20:36:11 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2011-04-12 20:36:11 (GMT)
commitb8c0e16eeb7496f71480c6a060144b0e050edcf5 (patch)
tree57f41578c3c5a7ccfb22591a9ec4f3fc2c697b85 /test
parentfc99b1ad515ccfc92ee92001c409f69385033af5 (diff)
downloadgoogletest-b8c0e16eeb7496f71480c6a060144b0e050edcf5.zip
googletest-b8c0e16eeb7496f71480c6a060144b0e050edcf5.tar.gz
googletest-b8c0e16eeb7496f71480c6a060144b0e050edcf5.tar.bz2
Fixes Sun C++ compiler errors (by Pasi Valminen)
Diffstat (limited to 'test')
-rw-r--r--test/gtest-printers_test.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc
index 1395c69..6292c7f 100644
--- a/test/gtest-printers_test.cc
+++ b/test/gtest-printers_test.cc
@@ -857,7 +857,7 @@ TEST(PrintStlContainerTest, HashMultiSet) {
#endif // GTEST_HAS_HASH_SET_
TEST(PrintStlContainerTest, List) {
- const char* a[] = {
+ const string a[] = {
"hello",
"world"
};
@@ -875,9 +875,15 @@ TEST(PrintStlContainerTest, Map) {
TEST(PrintStlContainerTest, MultiMap) {
multimap<bool, int> map1;
- map1.insert(make_pair(true, 0));
- map1.insert(make_pair(true, 1));
- map1.insert(make_pair(false, 2));
+ // The make_pair template function would deduce the type as
+ // pair<bool, int> here, and since the key part in a multimap has to
+ // be constant, without a templated ctor in the pair class (as in
+ // libCstd on Solaris), make_pair call would fail to compile as no
+ // implicit conversion is found. Thus explicit typename is used
+ // here instead.
+ map1.insert(pair<const bool, int>(true, 0));
+ map1.insert(pair<const bool, int>(true, 1));
+ map1.insert(pair<const bool, int>(false, 2));
EXPECT_EQ("{ (false, 2), (true, 0), (true, 1) }", Print(map1));
}