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
This commit is contained in:
parent
708021a809
commit
c85521c002
3 changed files with 172 additions and 0 deletions
19
Examples/test-suite/python/virtual_poly_runme.py
Normal file
19
Examples/test-suite/python/virtual_poly_runme.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue