summaryrefslogtreecommitdiff
path: root/Examples/test-suite/scilab/scilab_pointer_conversion_functions_runme.sci
blob: 1789c6111c9afa6204b4f662d98d06fd49285c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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(foo_addr, expected_foo_addr, "SWIG_this(pfoo_get())");

pfoo = SWIG_ptr(foo_addr);
checkequal(equalFooPointer(pfoo), %T, "equalFooPointer(pfoo)");

// Test conversion of mlist type pointers
stA = new_structA();
checkequal(typeof(stA), "_p_structA");
p = SWIG_ptr(stA);
checkequal(typeof(p), "pointer");

exec("swigtest.quit", -1);