PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/lua/imports_runme.lua

#
Lua | 28 lines | 9 code | 4 blank | 15 comment | 2 complexity | c7caa71bdbf81e5a216b017546a2199a MD5 | raw file
 1require("import")	-- the import fn
 2-- need to load two modules
 3import("imports_a")	-- import code
 4import("imports_b")	-- import code
 5
 6b=imports_b.B()
 7b:hello() -- call member function in A which is in a different SWIG generated library.
 8b:bye()
 9
10assert (b:member_virtual_test(imports_a.A_memberenum1) == imports_a.A_memberenum2)
11assert (b:global_virtual_test(imports_a.globalenum1) == imports_a.globalenum2)
12
13imports_b.global_test(imports_a.A_memberenum1)
14
15--[[    B b = new B();
16    b.hello(); //call member function in A which is in a different SWIG generated library.
17
18            B b = new B();
19        b.hello(); //call member function in A which is in a different SWIG generated library.
20        b.bye();
21
22        if (b.member_virtual_test(A.MemberEnum.memberenum1) != A.MemberEnum.memberenum2)
23          throw new Exception("Test 1 failed");
24        if (b.global_virtual_test(GlobalEnum.globalenum1) != GlobalEnum.globalenum2)
25          throw new Exception("Test 2 failed");
26
27        imports_b.global_test(A.MemberEnum.memberenum1);
28]]