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

17 lines
422 B
Lua
Raw Normal View History

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