From d3c06307eeb702e040cbd06222fa81a7363247cb Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Sat, 4 Feb 2006 00:02:03 +0000 Subject: [PATCH] add test for 'void *' argument git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8704 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/perl5/voidtest_runme.pl | 7 +++++++ Examples/test-suite/python/voidtest_runme.py | 13 +++++++++++++ Examples/test-suite/voidtest.i | 7 +++++++ 3 files changed, 27 insertions(+) create mode 100644 Examples/test-suite/perl5/voidtest_runme.pl diff --git a/Examples/test-suite/perl5/voidtest_runme.pl b/Examples/test-suite/perl5/voidtest_runme.pl new file mode 100644 index 000000000..9d9eaa05e --- /dev/null +++ b/Examples/test-suite/perl5/voidtest_runme.pl @@ -0,0 +1,7 @@ +use voidtest; + +$f = new voidtest::Foo(); +$v1 = voidtest::vfunc1($f); +$v2 = voidtest::vfunc2($f); +$v3 = voidtest::vfunc3($v1); +$v4 = voidtest::vfunc4($f); diff --git a/Examples/test-suite/python/voidtest_runme.py b/Examples/test-suite/python/voidtest_runme.py index 067b10740..229ae27a8 100644 --- a/Examples/test-suite/python/voidtest_runme.py +++ b/Examples/test-suite/python/voidtest_runme.py @@ -11,3 +11,16 @@ def fvoid(): if f.memberfunc() != fvoid(): raise RuntimeError + + +v1 = voidtest.vfunc1(f) +v2 = voidtest.vfunc2(f) +if v1 != v2: + raise RuntimeError + +v3 = voidtest.vfunc3(v1) +if v3.this != f.this: + raise RuntimeError +v4 = voidtest.vfunc1(f) +if v4 != v1: + raise RuntimeError diff --git a/Examples/test-suite/voidtest.i b/Examples/test-suite/voidtest.i index 01b8dc882..90779e227 100644 --- a/Examples/test-suite/voidtest.i +++ b/Examples/test-suite/voidtest.i @@ -12,5 +12,12 @@ public: static void staticmemberfunc(void) { } }; + +void *vfunc1(void *f) { return f; } +void *vfunc2(Foo *f) { return f; } +Foo *vfunc3(void *f) { return (Foo *) f; } +Foo *vfunc4(Foo *f) { return f; } + + %}