commit - 3ca30dfea990fd3fead1051d8bcd2d1402688bfe
commit + c1c5fada66cfd8dbfece3db5648747b81693ea2b
blob - f78992ee3b20ba6c7e9ba81801e9266459cc4c54
blob + a0ec2143109e33e0bc1c5a84b4576265163ca19c
--- tests/capi/torture_test.cc
+++ tests/capi/torture_test.cc
type == LUA_TFUNCTION ||
type == LUA_TLIGHTUSERDATA ||
type == LUA_TNIL ||
- type == LUA_TNONE ||
type == LUA_TNUMBER ||
type == LUA_TSTRING ||
type == LUA_TTABLE ||
return;
uint8_t key = fdp->ConsumeIntegral<uint8_t>();
lua_pushnumber(L, key);
+ top = lua_gettop(L);
lua_rawget(L, index);
- /* XXX: Wrong number of elements. */
- /* assert(lua_gettop(L) == top); */
+ assert(lua_gettop(L) == top);
}
/* void lua_rawset(lua_State *L, int index); */
uint8_t value = fdp->ConsumeIntegral<uint8_t>();
lua_pushnumber(L, value);
lua_pushnumber(L, key);
+ top = lua_gettop(L);
lua_rawset(L, index);
- /* XXX: Wrong number of elements. */
- /* assert(lua_gettop(L) == top - 2); */
+ assert(lua_gettop(L) == top - 2);
}
/* void lua_rawseti(lua_State *L, int index, lua_Integer i); */
return;
int n = fdp->ConsumeIntegral<uint8_t>();
__lua_pushnumber(L, fdp);
+ top = lua_gettop(L);
lua_rawseti(L, index, n);
- /* XXX: Wrong number of elements. */
- /* assert(lua_gettop(L) == top - 1); */
+ assert(lua_gettop(L) == top - 1);
}
/* int lua_rawgeti(lua_State *L, int index, lua_Integer n); */
lua_pop(L, 1);
lua_arith(L, op);
- /* XXX: Wrong number of elements. */
assert(lua_gettop(L) <= top - 1 + 1);
}
#endif /* LUA_VERSION_NUM */
uint8_t key = fdp->ConsumeIntegral<uint8_t>();
lua_pushnumber(L, key);
lua_gettable(L, index);
- /* XXX: Wrong number of elements. */
- /* assert(lua_gettop(L) == top); */
+ assert(lua_gettop(L) == top + 1);
}
/* void lua_rotate(lua_State *L, int idx, int n); */
return;
int n = fdp->ConsumeIntegral<uint8_t>();
__lua_pushnumber(L, fdp);
+ top = lua_gettop(L);
lua_seti(L, index, n);
- /* XXX: Wrong number of elements. */
- /* assert(lua_gettop(L) == top - 1); */
+ assert(lua_gettop(L) == top - 1);
}
#endif /* LUA_VERSION_NUM */
int nres;
res = lua_resume(co, L, 0, &nres);
#endif /* LUA_VERSION_NUM */
- /* XXX: Wrong exit code. */
/* assert(res == LUA_OK); */
(void)res;
lua_settop(co, 0);
assert(lua_gettop(L) == top + 1);
}
+/* const char *lua_tolstring(lua_State *L, int index, size_t *len); */
+/* [-0, +0, m] */
/* const char *luaL_tolstring(lua_State *L, int idx, size_t *len); */
/* [-0, +1, e] */
static void
auto idx = fdp->ConsumeIntegralInRange(1, top);
#if LUA_VERSION_NUM < 503
lua_tolstring(L, idx, NULL);
+ assert(lua_gettop(L) == top);
#else
luaL_tolstring(L, idx, NULL);
+ assert(lua_gettop(L) == top + 1);
#endif /* LUA_VERSION_NUM */
- /* XXX: Wrong number of elements. */
- /* assert(lua_gettop(L) == top + 1); */
}
/* void lua_copy(lua_State *L, int fromidx, int toidx); */