From 30ca38745ac2f81b35ea511c284fc9c586ba8e01 Mon Sep 17 00:00:00 2001 From: bel Date: Sat, 25 Jul 2015 19:18:55 +0200 Subject: [PATCH] mg_get_var unit test --- test/public.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/public.c b/test/public.c index 819b1a3c..6be375ec 100644 --- a/test/public.c +++ b/test/public.c @@ -266,18 +266,20 @@ START_TEST(test_mg_get_var) ck_assert_int_eq(ret, 10); ck_assert_str_eq("that is it", buf); - /* key without value in the middle of a longer string */ + /* key with = but without value in the middle of a longer string */ memset(buf, 77, sizeof(buf)); ret = mg_get_var2(longquery, strlen(longquery), "key5", buf, sizeof(buf), 0); ck_assert_int_eq(ret, 0); ck_assert_str_eq(buf, ""); + /* key without = and without value in the middle of a longer string */ memset(buf, 77, sizeof(buf)); ret = mg_get_var2(longquery, strlen(longquery), "key6", buf, sizeof(buf), 0); - ck_assert_int_eq(ret, 0); + ck_assert_int_eq(ret, -1); ck_assert_str_eq(buf, ""); + /* TODO: this is the same situation as with mg_get_value */ } END_TEST