diff options
author | Johannes Schickel | 2008-03-30 13:13:51 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-03-30 13:13:51 +0000 |
commit | a51c2657b6ae8c83826d1a73ceb4e6a477a7e4a6 (patch) | |
tree | e5395bde1485c762296365e7b6ba98718a623398 /test | |
parent | 3fffcec59e39496c208c32fc5cab8117f10eea05 (diff) | |
download | scummvm-rg350-a51c2657b6ae8c83826d1a73ceb4e6a477a7e4a6.tar.gz scummvm-rg350-a51c2657b6ae8c83826d1a73ceb4e6a477a7e4a6.tar.bz2 scummvm-rg350-a51c2657b6ae8c83826d1a73ceb4e6a477a7e4a6.zip |
Added checks for implicit SharedPtr casting functionallity.
svn-id: r31329
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; + } }; |