scilab: unsigned ints typemaps behave same as signed ints (1st commit: scalar)
This commit is contained in:
parent
4ba4591dba
commit
72c6552c2d
5 changed files with 175 additions and 91 deletions
|
|
@ -1,16 +1,16 @@
|
|||
exec("swigtest.start", -1);
|
||||
|
||||
checkequal(ref_int(3), 3, "ref_int() test fails.");
|
||||
checkequal(ref_uint(uint32(3)), uint32(3), "ref_uint() test fails.");
|
||||
checkequal(ref_uint(uint32(3)), 3, "ref_uint() test fails.");
|
||||
|
||||
checkequal(ref_short(3), 3, "ref_short() test fails.");
|
||||
checkequal(ref_ushort(uint16(3)), uint16(3), "ref_ushort() test fails.");
|
||||
checkequal(ref_ushort(uint16(3)), 3, "ref_ushort() test fails.");
|
||||
|
||||
checkequal(ref_long(3), 3, "ref_long() test fails.");
|
||||
checkequal(ref_ulong(uint32(3)), uint32(3), "ref_ulong() test fails.");
|
||||
checkequal(ref_ulong(uint32(3)), 3, "ref_ulong() test fails.");
|
||||
|
||||
checkequal(ref_schar(3), 3, "ref_schar() test fails.");
|
||||
checkequal(ref_uchar(uint8(3)), uint8(3), "ref_uchar() test fails.");
|
||||
checkequal(ref_uchar(uint8(3)), 3, "ref_uchar() test fails.");
|
||||
|
||||
checkequal(ref_float(3), 3, "ref_float() test fails.");
|
||||
checkequal(ref_double(3), 3, "ref_double() test fails.");
|
||||
|
|
|
|||
|
|
@ -8,50 +8,50 @@ checkequal(val_float(42), 42, "val_float() test fails.");
|
|||
checkequal(val_char('a'), 'a', "val_char() test fails.");
|
||||
checkequal(val_schar(42), 42, "val_schar() test fails.");
|
||||
checkequal(val_schar(int8(42)), 42, "val_schar() test fails.");
|
||||
checkequal(val_uchar(uint8(42)), uint8(42), "val_uchar() test fails.");
|
||||
checkequal(val_uchar(uint8(42)), 42, "val_uchar() test fails.");
|
||||
|
||||
checkequal(val_short(42), 42, "val_short() test fails.");
|
||||
checkequal(val_short(int16(42)), 42, "val_short() test fails.");
|
||||
checkequal(val_ushort(uint16(42)), uint16(42), "val_ushort() test fails.");
|
||||
checkequal(val_ushort(uint16(42)), 42, "val_ushort() test fails.");
|
||||
|
||||
checkequal(val_int(42), 42, "val_int() test fails.");
|
||||
checkequal(val_int(int32(42)), 42, "val_int() test fails.");
|
||||
checkequal(val_uint(uint32(42)), uint32(42), "val_uint() test fails.");
|
||||
checkequal(val_uint(uint32(42)), 42, "val_uint() test fails.");
|
||||
|
||||
checkequal(val_long(42), 42, "val_long() test fails.");
|
||||
checkequal(val_long(int32(42)), 42, "val_long() test fails.");
|
||||
checkequal(val_ulong(uint32(42)), uint32(42), "val_long() test fails.");
|
||||
checkequal(val_ulong(uint32(42)), 42, "val_long() test fails.");
|
||||
|
||||
checkequal(val_bool(%t), %t, "val_bool() test fails.");
|
||||
|
||||
// longlong is not supported in Scilab 5.x
|
||||
//checkequal(val_llong(42), 42, "val_llong() test fails.");
|
||||
//checkequal(val_llong(int64(42)), 42, "val_llong() test fails.");
|
||||
//checkequal(val_ullong(uint64(42)), uint64(42), "val_ullong() test fails.");
|
||||
//checkequal(val_ullong(uint64(42)), 42, "val_ullong() test fails.");
|
||||
|
||||
// Check passing by reference
|
||||
checkequal(ref_char('a'), 'a', "ref_char() test fails.");
|
||||
checkequal(ref_schar(42), 42, "ref_schar() test fails.");
|
||||
checkequal(ref_schar(int8(42)), 42, "ref_schar() test fails.");
|
||||
checkequal(ref_uchar(uint8(42)), uint8(42), "ref_uchar() test fails.");
|
||||
checkequal(ref_uchar(uint8(42)), 42, "ref_uchar() test fails.");
|
||||
|
||||
checkequal(ref_short(42), 42, "ref_short() test fails.")
|
||||
checkequal(ref_short(int16(42)), 42, "ref_short() test fails.")
|
||||
checkequal(ref_ushort(uint16(42)), uint16(42), "ref_ushort() test fails.")
|
||||
checkequal(ref_ushort(uint16(42)), 42, "ref_ushort() test fails.")
|
||||
|
||||
checkequal(ref_int(42), 42, "ref_int() test fails.");
|
||||
checkequal(ref_int(int32(42)), 42, "ref_int() test fails.");
|
||||
checkequal(ref_uint(uint32(42)), uint32(42), "ref_uint() test fails.");
|
||||
checkequal(ref_uint(uint32(42)), 42, "ref_uint() test fails.");
|
||||
|
||||
checkequal(ref_long(42), 42, "ref_long() test fails.");
|
||||
checkequal(ref_long(int32(42)), 42, "ref_long() test fails.");
|
||||
checkequal(ref_ulong(uint32(42)), uint32(42), "ref_ulong() test fails.");
|
||||
checkequal(ref_ulong(uint32(42)), 42, "ref_ulong() test fails.");
|
||||
|
||||
checkequal(ref_bool(%t), %t, "ref_bool() test fails.");
|
||||
|
||||
// long long is not supported in Scilab 5.x
|
||||
//checkequal(ref_llong(42), 42, "ref_llong() test fails.");
|
||||
//checkequal(ref_llong(int64(42)), 42, "ref_llong() test fails.");
|
||||
//checkequal(ref_ullong(uint64(42)), uint64(42), "ref_ullong() test fails.");
|
||||
//checkequal(ref_ullong(uint64(42)), 42, "ref_ullong() test fails.");
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue