swig/Examples/test-suite/python/virtual_poly_runme.py
Marcelo Matus c85521c002 Added a simple example where the current universal
Java wrapping mechanism doesn't work, showing the
need to use a different way to wrap polymorphic classes.

They are two runtime examples: one for java, which is
failing, and one for python, which works fine.

Detailed description of the case can be found
in the three files committed.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-22 06:26:44 +00:00

19 lines
290 B
Python

import virtual_poly
d = virtual_poly.NDouble(3.5)
i = virtual_poly.NInt(2)
dc = d.copy()
ic = i.copy()
if d.get() != dc.get():
raise RuntimeError
if i.get() != ic.get():
raise RuntimeError
ddc = virtual_poly.NDouble_dynamic_cast(dc)
if d.get() != ddc.get():
raise RuntimeError