diff options
| author | sanine <sanine.not@pm.me> | 2021-08-28 18:41:52 -0500 | 
|---|---|---|
| committer | sanine <sanine.not@pm.me> | 2021-08-28 18:41:52 -0500 | 
| commit | 279e5b994d4fb4600054e4d1a75596f418187d6a (patch) | |
| tree | 78f913ebea64b8e75e2d8046465b15581ff73b5b /src/tests | |
| parent | e0ee4f7428db6d3ba60eef7b54cf65cc021daf90 (diff) | |
fix error in hs_create_table type macros and correct bug in stack index test
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/hs_create_table_tests.c | 13 | 
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)			\  | 
