diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/common/ptr.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/common/ptr.h b/test/common/ptr.h index b7ed637040..11ed52d4b9 100644 --- a/test/common/ptr.h +++ b/test/common/ptr.h @@ -62,4 +62,18 @@ class PtrTestSuite : public CxxTest::TestSuite TS_ASSERT(p1 != 0); TS_ASSERT(p2 == 0); } + + struct A { + int a; + }; + + struct B : public A { + int b; + }; + + void test_cast() { + Common::SharedPtr<B> b(new B); + Common::SharedPtr<A> a(b); + a = b; + } }; |