scilab: add pointer conversion builtin functions swig_this & swig_ptr
This commit is contained in:
parent
b58d996743
commit
675c4cee0f
5 changed files with 97 additions and 7 deletions
|
|
@ -18,6 +18,7 @@ CPP_TEST_CASES += \
|
|||
primitive_types \
|
||||
inout \
|
||||
scilab_li_matrix \
|
||||
scilab_pointer_conversion_functions \
|
||||
|
||||
CPP_STD_TEST_CASES += \
|
||||
li_std_container_typemaps \
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
exec("swigtest.start", -1);
|
||||
|
||||
// Test on NULL
|
||||
null = getNull();
|
||||
checkequal(swig_this(null), 0, "swig_this(null)");
|
||||
|
||||
null = swig_ptr(0);
|
||||
checkequal(isNull(null), %T, "func(null)");
|
||||
|
||||
// Test on variable
|
||||
expected_foo_addr = getFooAddress();
|
||||
foo_addr = swig_this(pfoo_get());
|
||||
checkequal(uint32(foo_addr), expected_foo_addr, "swig_this(pfoo_get())");
|
||||
|
||||
pfoo = swig_ptr(foo_addr);
|
||||
checkequal(equalFooPointer(pfoo), %T, "equalFooPointer(pfoo)");
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
Loading…
Add table
Add a link
Reference in a new issue