summaryrefslogtreecommitdiff
path: root/src/tests/hs_create_table_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/hs_create_table_tests.c')
-rw-r--r--src/tests/hs_create_table_tests.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/tests/hs_create_table_tests.c b/src/tests/hs_create_table_tests.c
index e2c8ca8..b2b3f3c 100644
--- a/src/tests/hs_create_table_tests.c
+++ b/src/tests/hs_create_table_tests.c
@@ -11,9 +11,11 @@ static int testfunc(lua_State *L) { return 0; }
TEST(table_correct_index)
{
- int index = hs_create_table(L);
- mu_assert("returned incorrect index!", index == lua_gettop(L));
- return 0;
+ int top_old = lua_gettop(L);
+ int index = hs_create_table(L);
+ mu_assert("the stack is unchanged!", lua_gettop(L) != top_old);
+ mu_assert("returned incorrect index!", index == lua_gettop(L));
+ return 0;
}
#define load_key(index, value, pushf) do { \
@@ -56,11 +58,6 @@ TEST(table_correct_index)
lua_pop(L, 1); /* remove key */ \
} while(0)
-static inline compare_ptrs(lua_State *L, int index0, int index1)
-{
- return lua_topointer(L, index0) == lua_topointer(L, index1);
-}
-
#define checkval_bool(expected) \
check_value(lua_isboolean, "boolean", bool, lua_toboolean, value==expected)
#define checkval_int(expected) \