16 } // anonymous namespace
19 bool test_null_pointer()
21 using namespace luabind
;
23 lua_State
* L
= lua_open();
25 int top
= lua_gettop(L
);
33 function(L
, "get_pointer", get_pointer
);
34 if (dostring(L
, "e = get_pointer()")) return false;
36 lua_pushstring(L
, "e");
37 lua_gettable(L
, LUA_GLOBALSINDEX
);
38 if (!lua_isnil(L
, -1)) return false;
41 if (dostring(L
, "a = A() e = a:f()")) return false;
42 lua_pushstring(L
, "e");
43 lua_gettable(L
, LUA_GLOBALSINDEX
);
44 if (!lua_isnil(L
, -1)) return false;
47 if (top
!= lua_gettop(L
)) return false;