1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-01-10 08:20:14 +02:00
nn-usb-fpga/lua/examples/lua_calls_C5/test.lua

17 lines
413 B
Lua
Raw Normal View History

package.cpath = "./?.so"
2010-09-13 03:57:04 +03:00
require "wrap"
--test1
2010-09-13 03:57:04 +03:00
wrap.lib_a_f_1()
--test2
2010-09-13 03:57:04 +03:00
assert(6==wrap.lib_a_f_2(2,3))
--test3
2010-09-13 03:57:04 +03:00
assert(5==wrap.lib_a_f_3("hello"))
--test4 : use userdata to pass structure
2010-09-13 03:57:04 +03:00
t=wrap.point_new(3,6)
assert(18 == mylib.lib_a_f_4(t))
--test5, return userdata
2010-09-13 03:57:04 +03:00
t=wrap.lib_a_f_5()
assert(600 == wrap.lib_a_f_4(t))
assert(wrap.point_geta(t) == 20)
assert(wrap.point_getb(t) == 30)