scilab: fix tests for unsigned ints typemap changes

This commit is contained in:
Simon Marchetto 2014-06-16 16:03:50 +02:00
commit e324ad1c6c
2 changed files with 92 additions and 95 deletions

View file

@ -6,55 +6,50 @@ catch
swigtesterror(); swigtesterror();
end end
if Foo_x_get(foo)<>0 then swigtesterror(); end checkequal(Foo_x_get(foo), 0, "Foo_x_get()");
if typeof(Foo_x_get(foo))<>"constant" then swigtesterror(); end
if Foo_y_get(foo)<>0 then swigtesterror(); end checkequal(Foo_y_get(foo), 0, "Foo_y_get()");
if typeof(Foo_y_get(foo))<>"constant" then swigtesterror(); end
if Foo_z_get(foo)<>0 then swigtesterror(); end checkequal(Foo_z_get(foo), 0, "Foo_y_get()");
if typeof(Foo_z_get(foo))<>"constant" then swigtesterror(); end
if Foo_f_get(foo)<>uint32(0) then swigtesterror(); end checkequal(Foo_f_get(foo), 0, "Foo_f_get()");
if typeof(Foo_f_get(foo))<>"uint32" then swigtesterror(); end
if Foo_seq_get(foo)<>uint32(0) then swigtesterror(); end checkequal(Foo_seq_get(foo), 0, "Foo_seq_get()");
if typeof(Foo_seq_get(foo))<>"uint32" then swigtesterror(); end
try try
Foo_x_set(foo, 5); Foo_x_set(foo, 5);
catch catch
swigtesterror(); swigtesterror();
end end
if Foo_x_get(foo)<>5 then swigtesterror(); end checkequal(Foo_x_get(foo), 5, "Foo_x_get()");
try try
Foo_y_set(foo, 5); Foo_y_set(foo, 5);
catch catch
swigtesterror(); swigtesterror();
end end
if Foo_y_get(foo)<>5 then swigtesterror(); end checkequal(Foo_y_get(foo), 5, "Foo_y_get()");
try try
Foo_f_set(foo, uint32(5)); Foo_f_set(foo, 1);
catch catch
swigtesterror(); swigtesterror();
end end
if Foo_y_get(foo)<>uint32(5) then swigtesterror(); end checkequal(Foo_f_get(foo), 1, "Foo_f_get()");
try try
Foo_z_set(foo, 13); Foo_z_set(foo, 13);
catch catch
swigtesterror(); swigtesterror();
end end
if Foo_z_get(foo)<>13 then swigtesterror(); end checkequal(Foo_z_get(foo), 13, "Foo_z_get()");
try try
Foo_seq_set(foo, uint32(3)); Foo_seq_set(foo, 3);
catch catch
swigtesterror(); swigtesterror();
end end
if Foo_seq_get(foo)<>uint32(3) then swigtesterror(); end checkequal(Foo_seq_get(foo), 3, "Foo_seq_get()");
try try
delete_Foo(foo); delete_Foo(foo);

View file

@ -2,113 +2,115 @@ exec("swigtest.start", -1);
// double // double
if (in_double(22.22) <> 22.22) then swigtesterror(); end checkequal(in_double(22.22), 22.22, "in_double");
if (inr_double(22.22) <> 22.22) then swigtesterror(); end checkequal(inr_double(22.22), 22.22, "inr_double");
if (out_double(22.22) <> 22.22) then swigtesterror(); end checkequal(out_double(22.22), 22.22, "out_double");
if (outr_double(22.22) <> 22.22) then swigtesterror(); end checkequal(outr_double(22.22), 22.22, "outr_double");
if (inout_double(22.22) <> 22.22) then swigtesterror(); end checkequal(inout_double(22.22), 22.22, "inout_double");
if (inoutr_double(22.22) <> 22.22) then swigtesterror(); end checkequal(inoutr_double(22.22), 22.22, "inoutr_double");
// signed char // signed char
if (in_schar(22) <> 22) then swigtesterror(); end checkequal(in_schar(22), 22, "in_schar");
if (inr_schar(22) <> 22) then swigtesterror(); end checkequal(inr_schar(22), 22, "inr_schar");
if (out_schar(22) <> 22) then swigtesterror(); end checkequal(out_schar(22), 22, "out_schar");
if (outr_schar(22) <> 22) then swigtesterror(); end checkequal(outr_schar(22), 22, "outr_schar");
if (inoutr_schar(22) <> 22) then swigtesterror(); end checkequal(inout_schar(22), 22, "inout_schar");
checkequal(inoutr_schar(22), 22, "inoutr_schar");
// unsigned char // unsigned char
if (in_uchar(uint8(22)) <> uint8(22)) then swigtesterror(); end checkequal(in_uchar(uint8(22)), 22, "in_uchar");
if (inr_uchar(uint8(22)) <> uint8(22)) then swigtesterror(); end checkequal(inr_uchar(uint8(22)), 22, "inr_uchar");
if (out_uchar(uint8(22)) <> uint8(22)) then swigtesterror(); end checkequal(out_uchar(uint8(22)), 22, "out_uchar");
if (outr_uchar(uint8(22)) <> uint8(22)) then swigtesterror(); end checkequal(outr_uchar(uint8(22)), 22, "outr_uchar");
if (inoutr_uchar(uint8(22)) <> uint8(22)) then swigtesterror(); end checkequal(inout_uchar(uint8(22)), 22, "inout_uchar");
checkequal(inoutr_uchar(uint8(22)), 22, "inoutr_uchar");
// short // short
if (in_short(22) <> 22) then swigtesterror(); end checkequal(in_short(22), 22, "in_short");
if (inr_short(22) <> 22) then swigtesterror(); end checkequal(inr_short(22), 22, "inr_short");
if (out_short(22) <> 22) then swigtesterror(); end checkequal(out_short(22), 22, "out_short");
if (outr_short(22) <> 22) then swigtesterror(); end checkequal(outr_short(22), 22, "outr_short");
if (inout_short(22) <> 22) then swigtesterror(); end checkequal(inout_short(22), 22, "inout_short");
if (inoutr_short(22) <> 22) then swigtesterror(); end checkequal(inoutr_short(22), 22, "inoutr_short");
// unsigned short // unsigned short
if (in_ushort(uint16(22)) <> uint16(22)) then swigtesterror(); end checkequal(in_ushort(uint16(22)), 22, "in_ushort");
if (inr_ushort(uint16(22)) <> uint16(22)) then swigtesterror(); end checkequal(inr_ushort(uint16(22)), 22, "in_ushort");
if (out_ushort(uint16(22)) <> uint16(22)) then swigtesterror(); end checkequal(out_ushort(uint16(22)), 22, "out_ushort");
if (outr_ushort(uint16(22)) <> uint16(22)) then swigtesterror(); end checkequal(outr_ushort(uint16(22)), 22, "outr_ushort");
if (inout_ushort(uint16(22)) <> uint16(22)) then swigtesterror(); end checkequal(inout_ushort(uint16(22)), 22, "inout_ushort");
if (inoutr_ushort(uint16(22)) <> uint16(22)) then swigtesterror(); end checkequal(inoutr_ushort(uint16(22)), 22, "inoutr_ushort");
// int // int
if (in_int(22) <> 22) then swigtesterror(); end checkequal(in_int(22), 22, "in_int");
if (inr_int(22) <> 22) then swigtesterror(); end checkequal(inr_int(22), 22, "inr_int");
if (out_int(22) <> 22) then swigtesterror(); end checkequal(out_int(22), 22, "out_int");
if (outr_int(22) <> 22) then swigtesterror(); end checkequal(outr_int(22), 22, "outr_int");
if (inout_int(22) <> 22) then swigtesterror(); end checkequal(inout_int(22), 22, "inout_int");
if (inoutr_int(22) <> 22) then swigtesterror(); end checkequal(inoutr_int(22), 22, "inoutr_int");
// unsigned int // unsigned int
if (in_uint(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(in_uint(uint32(22)), 22, "in_uint");
if (inr_uint(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(inr_uint(uint32(22)), 22, "inr_uint");
if (out_uint(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(out_uint(uint32(22)), 22, "out_uint");
if (outr_uint(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(outr_uint(uint32(22)), 22, "outr_uint");
if (inout_uint(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(inout_uint(uint32(22)), 22, "inout_uint");
if (inoutr_uint(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(inoutr_uint(uint32(22)), 22, "inoutr_uint");
// long // long
if (in_long(22) <> 22) then swigtesterror(); end checkequal(in_long(22), 22, "in_long");
if (inr_long(22) <> 22) then swigtesterror(); end checkequal(inr_long(22), 22, "inr_long");
if (out_long(22) <> 22) then swigtesterror(); end checkequal(out_long(22), 22, "out_long");
if (outr_long(22) <> 22) then swigtesterror(); end checkequal(outr_long(22), 22, "outr_long");
if (inout_long(22) <> 22) then swigtesterror(); end checkequal(inout_long(22), 22, "inout_long");
if (inoutr_long(22) <> 22) then swigtesterror(); end checkequal(inoutr_long(22), 22, "inoutr_long");
// unsigned long // unsigned long
if (in_ulong(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(in_ulong(uint32(22)), 22, "in_ulong");
if (inr_ulong(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(inr_ulong(uint32(22)), 22, "inr_ulong");
if (out_ulong(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(out_ulong(uint32(22)), 22, "out_ulong");
if (outr_ulong(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(outr_ulong(uint32(22)), 22, "outr_ulong");
if (inout_ulong(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(inout_ulong(uint32(22)), 22, "inout_ulong");
if (inoutr_ulong(uint32(22)) <> uint32(22)) then swigtesterror(); end checkequal(inoutr_ulong(uint32(22)), 22, "inoutr_ulong");
// bool // bool
if (in_bool(%t) <> %t) then swigtesterror(); end checkequal(in_bool(%t), %t, "in_bool");
if (inr_bool(%f) <> %f) then swigtesterror(); end checkequal(inr_bool(%f), %f, "inr_bool");
if (out_bool(%t) <> %t) then swigtesterror(); end checkequal(out_bool(%t), %t, "out_bool");
if (outr_bool(%f) <> %f) then swigtesterror(); end checkequal(outr_bool(%f), %f, "outr_bool");
if (inout_bool(%t) <> %t) then swigtesterror(); end checkequal(inout_bool(%t), %t, "inout_bool");
if (inoutr_bool(%f) <> %f) then swigtesterror(); end checkequal(inoutr_bool(%f), %f, "inoutr_bool");
// float // float
if (in_float(2.5) <> 2.5) then swigtesterror(); end checkequal(in_float(2.5), 2.5, "in_float");
if (inr_float(2.5) <> 2.5) then swigtesterror(); end checkequal(inr_float(2.5), 2.5, "inr_float");
if (out_float(2.5) <> 2.5) then swigtesterror(); end checkequal(out_float(2.5), 2.5, "out_float");
if (outr_float(2.5) <> 2.5) then swigtesterror(); end checkequal(outr_float(2.5), 2.5, "outr_float");
if (inout_float(2.5) <> 2.5) then swigtesterror(); end checkequal(inout_float(2.5), 2.5, "inout_float");
if (inoutr_float(2.5) <> 2.5) then swigtesterror(); end checkequal(inoutr_float(2.5), 2.5, "inoutr_float");
// long long // long long
// Not supported in Scilab 5.5 // Not supported in Scilab 5.5
//if (in_longlong(22) <> 22) then swigtesterror(); end //checkequal(in_longlong(22), 22, "in_longlong");
//if (inr_longlong(22) <> 22) then swigtesterror(); end //checkequal(inr_longlong(22), 22, "inr_longlong");
//if (out_longlong(22) <> 22) then swigtesterror(); end //checkequal(out_longlong(22), 22, "out_longlong");
//if (outr_longlong(22) <> 22) then swigtesterror(); end //checkequal(outr_longlong(22), 22, "outr_longlong");
//if (inout_longlong(22) <> 22) then swigtesterror(); end //checkequal(inout_longlong(22), 22, "inout_longlong");
//if (inoutr_longlong(22) <> 22) then swigtesterror(); end //checkequal(inoutr_longlong(22), 22, "inoutr_longlong");
// unsigned long long // unsigned long long
// Not supported in Scilab 5.5 // Not supported in Scilab 5.5
//if (in_ulonglong(uint64(22)) <> 22) then swigtesterror(); end //checkequal(in_ulonglong(uint64(22)), 22, "in_ulonglong");
//if (inr_ulonglong(uint64(22)) <> 22) then swigtesterror(); end //checkequal(inr_ulonglong(uint64(22)), 22, "inr_ulonglong");
//if (out_ulonglong(uint64(22)) <> 22) then swigtesterror(); end //checkequal(out_ulonglong(uint64(22)), 22, "out_ulonglong");
//if (outr_ulonglong(uint64(22)) <> 22) then swigtesterror(); end //checkequal(outr_ulonglong(uint64(22)), 22, "outr_ulonglong");
//if (inout_ulonglong(uint64(22)) <> 22) then swigtesterror(); end //checkequal(inout_ulonglong(uint64(22)), 22, "inout_ulonglong");
//if (inoutr_ulonglong(uint64(22)) <> 22) then swigtesterror(); end //checkequal(inoutr_ulonglong(uint64(22)), 22, "inoutr_ulonglong");
// the others // the others
//a,b = inoutr_int2(1, 2); //a,b = inoutr_int2(1, 2);
//if (a<>1 || b<>2) then swigtesterror(); end //checkequal(a<>1 || b<>2), "");
//f,i = out_foo(10) //f,i = out_foo(10)
//if (f.a <> 10 || i <> 20) then swigtesterror(); end //checkequal(f.a, 10 || i, 20), "");
exec("swigtest.quit", -1); exec("swigtest.quit", -1);