From fc99b1ad515ccfc92ee92001c409f69385033af5 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Tue, 12 Apr 2011 18:24:59 +0000 Subject: Avoids iterator_traits, as it's not available in libCStd when compiled with Sun C++. --- test/gtest-port_test.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc index ff0165fe..1c6e2b09 100644 --- a/test/gtest-port_test.cc +++ b/test/gtest-port_test.cc @@ -39,7 +39,9 @@ # include #endif // GTEST_OS_MAC +#include #include // For std::pair and std::make_pair. +#include #include "gtest/gtest.h" #include "gtest/gtest-spi.h" @@ -172,6 +174,24 @@ TEST(ImplicitCastTest, CanUseImplicitConstructor) { EXPECT_TRUE(converted); } +TEST(IteratorTraitsTest, WorksForSTLContainerIterators) { + StaticAssertTypeEq::const_iterator>::value_type>(); + StaticAssertTypeEq::iterator>::value_type>(); +} + +TEST(IteratorTraitsTest, WorksForPointerToNonConst) { + StaticAssertTypeEq::value_type>(); + StaticAssertTypeEq::value_type>(); +} + +TEST(IteratorTraitsTest, WorksForPointerToConst) { + StaticAssertTypeEq::value_type>(); + StaticAssertTypeEq::value_type>(); +} + // Tests that the element_type typedef is available in scoped_ptr and refers // to the parameter type. TEST(ScopedPtrTest, DefinesElementType) { -- cgit v1.2.3