1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-01-10 16:50:14 +02:00
nn-usb-fpga/lua/examples/lua_calls_C5/test.lua
Carlos Camargo 7d9b7b803c Adding LUA tutorials: lua_calls_C1 - lua_calls_C5
Adding blinker demo: lua_blink_led
2010-09-06 20:24:53 -05:00

17 lines
422 B
Lua

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)