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.
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user