Implements the element_type typedef in testing::internal::scoped_ptr. This is needed to test gmock's IsNull/NotNull with it.
This commit is contained in:
parent
bf26ca01f2
commit
b6fe6899be
@ -589,6 +589,8 @@ bool IsTrue(bool condition);
|
||||
template <typename T>
|
||||
class scoped_ptr {
|
||||
public:
|
||||
typedef T element_type;
|
||||
|
||||
explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
|
||||
~scoped_ptr() { reset(); }
|
||||
|
||||
|
@ -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<int, ::testing::internal::scoped_ptr<int>::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; "
|
||||
|
Loading…
x
Reference in New Issue
Block a user