Upstream version 1.3.40
[profile/ivi/swig.git] / Examples / test-suite / lua / dynamic_cast_runme.lua
1 require("import")       -- the import fn
2 import("dynamic_cast")  -- import code
3
4 f = dynamic_cast.Foo()
5 b = dynamic_cast.Bar()
6
7 x = f:blah()
8 y = b:blah()
9
10 -- swig_type is a swiglua specific function which gets the swig_type_info's name
11 assert(swig_type(f)==swig_type(x))
12 assert(swig_type(b)==swig_type(y))
13
14 -- the real test: is y a Foo* or a Bar*?
15 assert(dynamic_cast.do_test(y)=="Bar::test")