diff --git a/Examples/test-suite/scilab/voidtest_runme.sci b/Examples/test-suite/scilab/voidtest_runme.sci new file mode 100644 index 000000000..c02c286bf --- /dev/null +++ b/Examples/test-suite/scilab/voidtest_runme.sci @@ -0,0 +1,21 @@ +exec("swigtest.start", -1); + +globalfunc(); + +f = new_Foo(); +Foo_memberfunc(f); + +Foo_staticmemberfunc(); + +v1 = vfunc1(f); +if ~equalvoidptr(vfunc1(f), f) then swigtesterror("vfunc1(f) <> f"); end + +if ~equalvoidptr(vfunc2(f), f) then swigtesterror("vfunc2(f) <> f"); end + +v3 = vfunc3(v1); +if ~equalvoidptr(v3, f) then swigtesterror("vfunc3(v1) <> f"); end + +Foo_memberfunc(v3); + +exec("swigtest.quit", -1); + diff --git a/Examples/test-suite/voidtest.i b/Examples/test-suite/voidtest.i index 90779e227..527c6c422 100644 --- a/Examples/test-suite/voidtest.i +++ b/Examples/test-suite/voidtest.i @@ -17,7 +17,12 @@ 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; } - %} - + +#ifdef SWIGSCILAB +%inline %{ +bool equalvoidptr(void *f, void *g) { return f == g; } +%} +#endif +