diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index 4175fcc1..c67fbd3f 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -589,6 +589,8 @@ bool IsTrue(bool condition); template class scoped_ptr { public: + typedef T element_type; + explicit scoped_ptr(T* p = NULL) : ptr_(p) {} ~scoped_ptr() { reset(); } diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc index 0fbe5c51..a2b0059e 100644 --- a/test/gtest-port_test.cc +++ b/test/gtest-port_test.cc @@ -53,6 +53,14 @@ namespace testing { namespace internal { +// Tests that the element_type typedef is available in scoped_ptr and refers +// to the parameter type. +TEST(ScopedPtrTest, DefinesElementType) { + StaticAssertTypeEq::element_type>(); +} + +// TODO(vladl@google.com): Implement THE REST of scoped_ptr tests. + TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) { if (AlwaysFalse()) GTEST_CHECK_(false) << "This should never be executed; "