/
primitive_types_runme.sci
58 lines (42 loc) · 2.22 KB
/
primitive_types_runme.sci
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
exec("swigtest.start", -1);
// Check passing by value
if (val_double(42) <> 42) then swigtesterror(); end
if (val_float(42) <> 42) then swigtesterror(); end
if (val_char('a') <> 'a') then swigtesterror(); end
if (val_schar(42) <> 42) then swigtesterror(); end
if (val_schar(int8(42)) <> 42) then swigtesterror(); end
if (val_uchar(uint8(42)) <> uint8(42)) then swigtesterror(); end
if (val_short(42) <> 42) then swigtesterror(); end
if (val_short(int16(42)) <> 42) then swigtesterror(); end
if (val_ushort(uint16(42)) <> uint16(42)) then swigtesterror(); end
if (val_int(42) <> 42) then swigtesterror(); end
if (val_int(int32(42)) <> 42) then swigtesterror(); end
if (val_uint(uint32(42)) <> uint32(42)) then swigtesterror(); end
if (val_long(42) <> 42) then swigtesterror(); end
if (val_long(int32(42)) <> 42) then swigtesterror(); end
if (val_ulong(uint32(42)) <> uint32(42)) then swigtesterror(); end
if (val_bool(%t) <> %t) then swigtesterror(); end
// longlong is not supported in Scilab 5.x
//if (val_llong(42) <> 42) then swigtesterror(); end
//if (val_llong(int64(42)) <> 42) then swigtesterror(); end
//if (val_ullong(uint64(42)) <> uint64(42)) then swigtesterror(); end
// Check passing by reference
if (ref_char('a') <> 'a') then swigtesterror(); end
if (ref_schar(42) <> 42) then swigtesterror(); end
if (ref_schar(int8(42)) <> 42) then swigtesterror(); end
if (ref_uchar(uint8(42)) <> uint8(42)) then swigtesterror(); end
if (ref_short(42) <> 42) then swigtesterror(); end
if (ref_short(int16(42)) <> 42) then swigtesterror(); end
if (ref_ushort(uint16(42)) <> uint16(42)) then swigtesterror(); end
if (ref_int(42) <> 42) then swigtesterror(); end
if (ref_int(int32(42)) <> 42) then swigtesterror(); end
if (ref_uint(uint32(42)) <> uint32(42)) then swigtesterror(); end
if (ref_long(42) <> 42) then swigtesterror(); end
if (ref_long(int32(42)) <> 42) then swigtesterror(); end
if (ref_ulong(uint32(42)) <> uint32(42)) then swigtesterror(); end
if (ref_bool(%t) <> %t) then swigtesterror(); end
// long long is not supported in Scilab 5.x
//if (ref_llong(42) <> 42) then swigtesterror(); end
//if (ref_llong(int64(42)) <> 42) then swigtesterror(); end
//if (ref_ullong(uint64(42)) <> uint64(42)) then swigtesterror(); end
exec("swigtest.quit", -1);