PageRenderTime 38ms CodeModel.GetById 16ms 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
  1. require("import") -- the import fn
  2. import("primitive_ref") -- import code
  3. pr=primitive_ref --alias
  4. assert(pr.ref_int(3)==3)
  5. assert(pr.ref_uint(3) == 3)
  6. assert(pr.ref_short(3) == 3)
  7. assert(pr.ref_ushort(3) == 3)
  8. assert(pr.ref_long(3) == 3)
  9. assert(pr.ref_ulong(3) == 3)
  10. assert(pr.ref_schar(3) == 3)
  11. assert(pr.ref_uchar(3) == 3)
  12. assert(pr.ref_float(3.5) == 3.5)
  13. assert(pr.ref_double(3.5) == 3.5)
  14. assert(pr.ref_bool(true) == true)
  15. assert(pr.ref_char('x') == 'x')
  16. assert(pr.ref_over(0) == 0)
  17. a=pr.A(12)
  18. assert(pr.ref_over(a)==12)