1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

mg_get_var unit test

This commit is contained in:
bel
2015-07-25 19:15:07 +02:00
parent 7c413551fc
commit b335a42d19

View File

@@ -270,10 +270,14 @@ START_TEST(test_mg_get_var)
memset(buf, 77, sizeof(buf)); memset(buf, 77, sizeof(buf));
ret = ret =
mg_get_var2(longquery, strlen(longquery), "key5", buf, sizeof(buf), 0); mg_get_var2(longquery, strlen(longquery), "key5", buf, sizeof(buf), 0);
ck_assert_int_eq(ret, -1); ck_assert_int_eq(ret, 0);
/* TODO: we can not distinguish between "key not found" and "key has no ck_assert_str_eq(buf, "");
* value"
* -> this is a problem in the API */ 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_str_eq(buf, "");
} }
END_TEST END_TEST