summaryrefslogtreecommitdiff
path: root/tests/lib/test_frrlua.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/test_frrlua.c')
-rw-r--r--tests/lib/test_frrlua.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/lib/test_frrlua.c b/tests/lib/test_frrlua.c
index 4f492db5bf..2760a273bd 100644
--- a/tests/lib/test_frrlua.c
+++ b/tests/lib/test_frrlua.c
@@ -13,19 +13,28 @@ static void test_encode_decode(void)
{
lua_State *L = luaL_newstate();
- long long a = 123;
- long long b = a;
+ int a = 123;
+ int b = a;
lua_pushintegerp(L, &a);
lua_decode_integerp(L, -1, &a);
assert(a == b);
assert(lua_gettop(L) == 0);
+ long long ll_a = 123L;
+ long long ll_b = a;
+
+ lua_pushlonglongp(L, &ll_a);
+ lua_decode_longlongp(L, -1, &ll_a);
+ assert(ll_a == ll_b);
+ assert(lua_gettop(L) == 0);
+
time_t time_a = 100;
- time_t time_b = time_a;
+ time_t time_b;
- lua_pushtimet(L, &time_a);
- lua_decode_timet(L, -1, &time_a);
+ lua_pushinteger(L, time_a);
+ time_b = lua_tointeger(L, -1);
+ lua_pop(L, 1);
assert(time_a == time_b);
assert(lua_gettop(L) == 0);