[Scummvm-cvs-logs] SF.net SVN: scummvm: [31329] scummvm/trunk/test/common/ptr.h

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Mar 30 15:13:51 CEST 2008


Revision: 31329
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31329&view=rev
Author:   lordhoto
Date:     2008-03-30 06:13:51 -0700 (Sun, 30 Mar 2008)

Log Message:
-----------
Added checks for implicit SharedPtr casting functionallity.

Modified Paths:
--------------
    scummvm/trunk/test/common/ptr.h

Modified: scummvm/trunk/test/common/ptr.h
===================================================================
--- scummvm/trunk/test/common/ptr.h	2008-03-30 12:46:21 UTC (rev 31328)
+++ scummvm/trunk/test/common/ptr.h	2008-03-30 13:13:51 UTC (rev 31329)
@@ -62,4 +62,18 @@
 		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;
+	}
 };


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list