16 } // anonymous namespace
19 bool test_null_pointer()
21 using namespace luabind
;
23 lua_State
* L
= lua_open();
25 int top
= lua_gettop(L
);
35 def("get_pointer", get_pointer
)
37 if (dostring(L
, "e = get_pointer()")) return false;
39 lua_pushstring(L
, "e");
40 lua_gettable(L
, LUA_GLOBALSINDEX
);
41 if (!lua_isnil(L
, -1)) return false;
44 if (dostring(L
, "a = A() e = a:f()")) return false;
45 lua_pushstring(L
, "e");
46 lua_gettable(L
, LUA_GLOBALSINDEX
);
47 if (!lua_isnil(L
, -1)) return false;
50 if (top
!= lua_gettop(L
)) return false;