summaryrefslogtreecommitdiff
path: root/tests/lib/test_frrlua.c
diff options
context:
space:
mode:
authorDonald Lee <dlqs@gmx.com>2021-08-10 04:41:25 +0800
committerQuentin Young <qlyoung@qlyoung.net>2023-11-20 20:45:02 -0500
commitd2acf63f16837caaadd093927c236b742c19fd75 (patch)
tree9a6b11c90de0c01a40ceb8e8d5fa60afb22bbb3e /tests/lib/test_frrlua.c
parentac91b343d635f056e8de47224719ed6218e79dfb (diff)
lib: Create encoders for int and rename stuff
Create encoders/decoders for int and rename current int encoders /decoders to long long. Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'tests/lib/test_frrlua.c')
-rw-r--r--tests/lib/test_frrlua.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/lib/test_frrlua.c b/tests/lib/test_frrlua.c
index 701e171c84..2760a273bd 100644
--- a/tests/lib/test_frrlua.c
+++ b/tests/lib/test_frrlua.c
@@ -13,14 +13,22 @@ 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;