diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-03-09 01:13:19 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-03-09 01:13:19 +0000 |
commit | 5451ffe816cafe4f0f51813eb8ddedb3543f0fea (patch) | |
tree | fa0e72e4f75615101b80684a921222b52c6286dd /test | |
parent | 603533a0a4dcfc2ef33051b9ae8237568a19adc4 (diff) | |
download | googletest-5451ffe816cafe4f0f51813eb8ddedb3543f0fea.tar.gz googletest-5451ffe816cafe4f0f51813eb8ddedb3543f0fea.tar.bz2 googletest-5451ffe816cafe4f0f51813eb8ddedb3543f0fea.zip |
Makes IsContainerTest compatible with Sun C++ and Visual Age C++, based on Hady Zalek's report and experiment; also fixes a bug that causes it to think that a class named const_iterator is a container; also clarifies the Borland C++ compatibility fix in the comments based on Josh Kelley's suggestion.
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest-printers_test.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/gtest-printers_test.cc b/test/gtest-printers_test.cc index 8992a9a7..e0065e2f 100644 --- a/test/gtest-printers_test.cc +++ b/test/gtest-printers_test.cc @@ -936,6 +936,28 @@ TEST(PrintStlContainerTest, TwoDimensionalNativeArray) { EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b)); } +// Tests that a class named iterator isn't treated as a container. + +struct iterator { + char x; +}; + +TEST(PrintStlContainerTest, Iterator) { + iterator it = {}; + EXPECT_EQ("1-byte object <00>", Print(it)); +} + +// Tests that a class named const_iterator isn't treated as a container. + +struct const_iterator { + char x; +}; + +TEST(PrintStlContainerTest, ConstIterator) { + const_iterator it = {}; + EXPECT_EQ("1-byte object <00>", Print(it)); +} + #if GTEST_HAS_TR1_TUPLE // Tests printing tuples. |