PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-29/SWIG/Examples/test-suite/lua/newobject1_runme.lua

#
Lua | 16 lines | 12 code | 4 blank | 0 comment | 4 complexity | 507f6a2862338ed289593e4698e2faa9 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("newobject1") -- import code
  3. foo1 = newobject1.Foo_makeFoo() -- lua doesnt yet support static fns properly
  4. assert(newobject1.Foo_fooCount() == 1) -- lua doesnt yet support static fns properly
  5. foo2 = foo1:makeMore()
  6. assert(newobject1.Foo_fooCount() == 2)
  7. foo1 = nil
  8. collectgarbage()
  9. assert(newobject1.Foo_fooCount() == 1)
  10. foo2 = nil
  11. collectgarbage()
  12. assert(newobject1.Foo_fooCount() == 0)