[luabind-cvs] luabind/luabind/test test_lua_classes.cpp,1.26.2.2,1.26.2.3
Brought to you by:
arvidn,
daniel_wallin
From: Arvid N. <ar...@us...> - 2005-10-18 16:03:42
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17908/test Modified Files: Tag: beta7-devel2 test_lua_classes.cpp Log Message: added a test to lua_test_classes that fails. Index: test_lua_classes.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_lua_classes.cpp,v retrieving revision 1.26.2.2 retrieving revision 1.26.2.3 diff -u -d -r1.26.2.2 -r1.26.2.3 --- test_lua_classes.cpp 29 Jul 2005 02:41:02 -0000 1.26.2.2 +++ test_lua_classes.cpp 18 Oct 2005 16:03:25 -0000 1.26.2.3 @@ -136,6 +136,15 @@ int f(int, int) { return 2; } }; +struct V +{ + int f(int,int) { return 2; } +}; + +struct W : V +{ +}; + void test_main(lua_State* L) { module(L) @@ -163,7 +172,11 @@ class_<U, T_>("U") .def(constructor<>()) .def("f", &U::f) - .def("g", &U::g) + .def("g", &U::g), + + class_<W>("W") + .def(constructor<>()) + .def("f", &V::f) ]; try @@ -183,6 +196,10 @@ } DOSTRING(L, + "w = W()\n" + "assert(w:f(1,1) == 2)"); + + DOSTRING(L, "u = U()\n" "assert(u:f(0) == 1)\n" "assert(u:f(0,0) == 2)\n" |