PageRenderTime 23ms CodeModel.GetById 21ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Examples/test-suite/lua/primitive_ref_runme.lua

#
Lua | 32 lines | 18 code | 14 blank | 0 comment | 12 complexity | 06d13bc767cc8c12267b1e72135bd927 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1require("import")	-- the import fn
 2import("primitive_ref")	-- import code
 3pr=primitive_ref --alias
 4
 5assert(pr.ref_int(3)==3)
 6
 7assert(pr.ref_uint(3) == 3)
 8
 9assert(pr.ref_short(3) == 3)
10
11assert(pr.ref_ushort(3) == 3)
12
13assert(pr.ref_long(3) == 3)
14
15assert(pr.ref_ulong(3) == 3)
16
17assert(pr.ref_schar(3) == 3)
18
19assert(pr.ref_uchar(3) == 3)
20
21assert(pr.ref_float(3.5) == 3.5)
22
23assert(pr.ref_double(3.5) == 3.5)
24
25assert(pr.ref_bool(true) == true)
26
27assert(pr.ref_char('x') == 'x')
28
29assert(pr.ref_over(0) == 0)
30
31a=pr.A(12)
32assert(pr.ref_over(a)==12)