scilab: implement and fix test array_member

This commit is contained in:
Simon Marchetto 2014-03-19 10:45:42 +01:00
commit 0bf11ef2d6
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,16 @@
exec("swigtest.start", -1);
f = new_Foo();
Foo_data_set(f, [0:7]);
if ~isequal(Foo_data_get(f), [0:7]) then swigtesterror(); end
Foo_text_set(f, 'abcdefgh');
if ~isequal(Foo_text_get(f), 'abcdefgh') then swigtesterror(); end
delete_Foo(f);
m = new_MyBuff();
MyBuff_x_set(m, uint8([0:11]));
if ~isequal(MyBuff_x_get(m), uint8([0:11])) then swigtesterror(); end
delete_MyBuff(m);
exec("swigtest.quit", -1);

View file

@ -55,7 +55,9 @@
%define %scilab_array_typemaps(CTYPE, ASARRAY_FRAGMENT, FROMARRAY_FRAGMENT, TEMPDATATYPE)
%scilab_asarrayandsize_withcopy(varin, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE);
%scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[ANY], TEMPDATATYPE);
%scilab_fromarrayandsize(varout, FROMARRAY_FRAGMENT, CTYPE[ANY]);
%scilab_fromarrayandsize(out, FROMARRAY_FRAGMENT, CTYPE[ANY]);
%apply SWIGTYPE[] { CTYPE[] };
%scilab_asarray_withallocatecopy(in, ASARRAY_FRAGMENT, CTYPE[], TEMPDATATYPE);