From: <le...@us...> - 2012-08-01 00:51:56
|
Revision: 13480 http://swig.svn.sourceforge.net/swig/?rev=13480&view=rev Author: leiflm Date: 2012-08-01 00:51:50 +0000 (Wed, 01 Aug 2012) Log Message: ----------- Extend test to check dynamic binding of virtual methods Modified Paths: -------------- branches/gsoc2012-c/Examples/test-suite/c/cpp_basic_class_virtual_method_runme.c Modified: branches/gsoc2012-c/Examples/test-suite/c/cpp_basic_class_virtual_method_runme.c =================================================================== --- branches/gsoc2012-c/Examples/test-suite/c/cpp_basic_class_virtual_method_runme.c 2012-07-31 21:15:33 UTC (rev 13479) +++ branches/gsoc2012-c/Examples/test-suite/c/cpp_basic_class_virtual_method_runme.c 2012-08-01 00:51:50 UTC (rev 13480) @@ -6,14 +6,19 @@ BaseClass *bc = new_BaseClass(); NonMethodOverwritingClass *noc = new_NonMethodOverwritingClass(); MethodOverwritingClass *oc = new_MethodOverwritingClass(); + BaseClass *inherited_bc = (BaseClass*)new_MethodOverwritingClass(); assert(BaseClass_myInt(bc) == 0xba53); assert(NonMethodOverwritingClass_myInt(noc) == 0xba53); assert(MethodOverwritingClass_myInt(oc) == 0xa173123d); + assert(BaseClass_myInt((BaseClass*)noc) == 0xba53); + assert(BaseClass_myInt((BaseClass*)oc) == 0xa173123d); + assert(BaseClass_myInt(inherited_bc) == 0xa173123d); delete_BaseClass(bc); delete_NonMethodOverwritingClass(noc); delete_MethodOverwritingClass(oc); + delete_BaseClass(inherited_bc); return 0; -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |