add test for 'void *' argument
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8704 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ffb572742b
commit
d3c06307ee
3 changed files with 27 additions and 0 deletions
7
Examples/test-suite/perl5/voidtest_runme.pl
Normal file
7
Examples/test-suite/perl5/voidtest_runme.pl
Normal file
|
|
@ -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);
|
||||||
|
|
@ -11,3 +11,16 @@ def fvoid():
|
||||||
|
|
||||||
if f.memberfunc() != fvoid():
|
if f.memberfunc() != fvoid():
|
||||||
raise RuntimeError
|
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
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,12 @@ public:
|
||||||
static void staticmemberfunc(void) { }
|
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; }
|
||||||
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue