Fix wrapping of function pointers and member function pointers when the function returns by reference
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12157 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2d8b51684d
commit
568607c5ea
7 changed files with 67 additions and 4 deletions
9
Examples/test-suite/python/funcptr_cpp_runme.py
Normal file
9
Examples/test-suite/python/funcptr_cpp_runme.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from funcptr_cpp import *
|
||||
|
||||
if call1(ADD_BY_VALUE, 10, 11) != 21:
|
||||
raise RuntimeError
|
||||
if call2(ADD_BY_POINTER, 12, 13) != 25:
|
||||
raise RuntimeError
|
||||
if call3(ADD_BY_REFERENCE, 14, 15) != 29:
|
||||
raise RuntimeError
|
||||
|
||||
|
|
@ -41,3 +41,6 @@ memberPtr = NULLPT
|
|||
check ("Square area ", 100.0, do_op(s,AREAPT))
|
||||
check ("Square perim", 40.0, do_op(s,PERIMPT))
|
||||
|
||||
check ("Add by value", 3, call1(ADD_BY_VALUE, 1, 2))
|
||||
check ("Add by pointer", 7, call2(ADD_BY_POINTER, 3, 4))
|
||||
check ("Add by reference", 11, call3(ADD_BY_REFERENCE, 5, 6))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue