OOLua  2.0.1
C++ and Lua binding
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Known limitations

Incorrect creation of userdata

OOLua incorrectly creates a new userdata when it should reuse one which has already been created.

See Also
http://code.google.com/p/oolua/issues/detail?id=5
void differentRootsOfaTree_twoRootsPassedToLua_luaUdComparesEqual()
{
OOLUA::register_class<DerivedFromTwoAbstractBasesAndAbstract3>(*m_lua);
DerivedFromTwoAbstractBasesAndAbstract3 derived;
Abstract2* a2 = &derived;
Abstract3* a3 = &derived;
OOLUA::push(*m_lua, a2);
OOLUA::push(*m_lua, a3);
OOLUA::INTERNAL::Lua_ud* ud_a2 = static_cast<OOLUA::INTERNAL::Lua_ud*>(lua_touserdata(*m_lua,-2));
OOLUA::INTERNAL::Lua_ud* ud_a3 = static_cast<OOLUA::INTERNAL::Lua_ud*>(lua_touserdata(*m_lua,-1));
CPPUNIT_ASSERT_EQUAL(true, ud_a2 == ud_a3);
}