Lines Matching refs:ret
48 int ret, len; in START_TEST() local
56 ret = sscanf(ver, "%u.%u", &major, &minor); in START_TEST()
57 ck_assert_int_eq(ret, 2); in START_TEST()
112 ret = mg_get_system_info(buf, len + 1); in START_TEST()
113 ck_assert_int_eq(len, ret); in START_TEST()
114 ret = (int)strlen(buf); in START_TEST()
115 ck_assert_int_eq(len, ret); in START_TEST()
124 ret = mg_get_context_info(ctx, buf, len + 100); in START_TEST()
125 ck_assert_int_gt(ret, 0); in START_TEST()
127 ck_assert_int_eq(len, ret); in START_TEST()
136 ret = mg_get_context_info(ctx, buf, len + 100); in START_TEST()
137 ck_assert_int_gt(ret, 0); in START_TEST()
139 ck_assert_int_eq(len, ret); in START_TEST()
242 int ret; in START_TEST() local
247 ret = mg_get_cookie("", "notfound", NULL, 999); in START_TEST()
248 ck_assert_int_eq(ret, -2); in START_TEST()
251 ret = mg_get_cookie("", "notfound", buf, 0); in START_TEST()
252 ck_assert_int_eq(ret, -2); in START_TEST()
255 ret = mg_get_cookie("key=toooooooooolong", "key", buf, 4); in START_TEST()
256 ck_assert_int_eq(ret, -3); in START_TEST()
259 ret = mg_get_cookie("", "notfound", buf, sizeof(buf)); in START_TEST()
260 ck_assert_int_eq(ret, -1); in START_TEST()
262 ret = mg_get_cookie(longcookie, "notfound", buf, sizeof(buf)); in START_TEST()
263 ck_assert_int_eq(ret, -1); in START_TEST()
266 ret = mg_get_cookie("key1=1; key2=2; key3=3", "notfound", buf, sizeof(buf)); in START_TEST()
267 ck_assert_int_eq(ret, -1); in START_TEST()
271 ret = mg_get_cookie("key1=1; key2=2; key3=3", "key1", buf, sizeof(buf)); in START_TEST()
272 ck_assert_int_eq(ret, 1); in START_TEST()
276 ret = mg_get_cookie("key1=1; key2=2; key3=3", "key2", buf, sizeof(buf)); in START_TEST()
277 ck_assert_int_eq(ret, 1); in START_TEST()
281 ret = mg_get_cookie("key1=1; key2=2; key3=3", "key3", buf, sizeof(buf)); in START_TEST()
282 ck_assert_int_eq(ret, 1); in START_TEST()
287 ret = mg_get_cookie(longcookie, "key7", buf, sizeof(buf)); in START_TEST()
288 ck_assert_int_eq(ret, 10); in START_TEST()
293 ret = mg_get_cookie(longcookie, "key5", buf, sizeof(buf)); in START_TEST()
294 ck_assert_int_eq(ret, 0); in START_TEST()
299 ret = mg_get_cookie(longcookie, "key6", buf, sizeof(buf)); in START_TEST()
300 ck_assert_int_eq(ret, -1); in START_TEST()
309 int ret; in START_TEST() local
316 ret = mg_get_var2("", 0, "notfound", NULL, 999, 0); in START_TEST()
317 ck_assert_int_eq(ret, -2); in START_TEST()
320 ret = mg_get_var2("", 0, "notfound", buf, 0, 0); in START_TEST()
321 ck_assert_int_eq(ret, -2); in START_TEST()
324 ret = mg_get_var2("key=toooooooooolong", 19, "key", buf, 4, 0); in START_TEST()
328 ck_assert(ret < 0); in START_TEST()
331 ret = mg_get_var2("", 0, "notfound", buf, sizeof(buf), 0); in START_TEST()
332 ck_assert_int_eq(ret, -1); in START_TEST()
334 ret = mg_get_var2( in START_TEST()
336 ck_assert_int_eq(ret, -1); in START_TEST()
339 ret = mg_get_var2( in START_TEST()
341 ck_assert_int_eq(ret, -1); in START_TEST()
344 ret = mg_get_var2("key1=1&key2=2&key3=3¬found=here", in START_TEST()
350 ck_assert_int_eq(ret, -1); in START_TEST()
353 ret = mg_get_var2( in START_TEST()
355 ck_assert_int_eq(ret, -1); in START_TEST()
359 ret = mg_get_var2( in START_TEST()
361 ck_assert_int_eq(ret, 1); in START_TEST()
365 ret = mg_get_var2( in START_TEST()
367 ck_assert_int_eq(ret, 1); in START_TEST()
371 ret = mg_get_var2( in START_TEST()
373 ck_assert_int_eq(ret, 1); in START_TEST()
378 ret = mg_get_var(shortquery, strlen(shortquery), "key1", buf, sizeof(buf)); in START_TEST()
379 ck_assert_int_eq(ret, 1); in START_TEST()
384 ret = in START_TEST()
386 ck_assert_int_eq(ret, 10); in START_TEST()
392 ret = in START_TEST()
394 ck_assert_int_eq(ret, 10); in START_TEST()
399 ret = in START_TEST()
401 ck_assert_int_eq(ret, 0); in START_TEST()
406 ret = in START_TEST()
408 ck_assert_int_eq(ret, -1); in START_TEST()
418 char *ret; in START_TEST() local
426 ret = mg_md5(buf, NULL); in START_TEST()
428 ck_assert_str_eq(ret, "d41d8cd98f00b204e9800998ecf8427e"); in START_TEST()
429 ck_assert_ptr_eq(ret, buf); in START_TEST()
432 ret = mg_md5(buf, "The quick brown fox jumps over the lazy dog.", NULL); in START_TEST()
434 ck_assert_str_eq(ret, "e4d909c290d0fb1ca068ffaddf22cbd0"); in START_TEST()
435 ck_assert_ptr_eq(ret, buf); in START_TEST()
438 ret = mg_md5(buf, in START_TEST()
452 ck_assert_str_eq(ret, "e4d909c290d0fb1ca068ffaddf22cbd0"); in START_TEST()
453 ck_assert_ptr_eq(ret, buf); in START_TEST()
456 ret = mg_md5(buf, long_str, NULL); in START_TEST()
458 ck_assert_str_eq(ret, "1cb13cf9f16427807f081b2138241f08"); in START_TEST()
459 ck_assert_ptr_eq(ret, buf); in START_TEST()
462 ret = mg_md5(buf, long_str + 1, NULL); in START_TEST()
464 ck_assert_str_eq(ret, "cf62d3264334154f5779d3694cc5093f"); in START_TEST()
465 ck_assert_ptr_eq(ret, buf); in START_TEST()
473 int ret; in START_TEST() local
476 ret = mg_url_encode("abc", buf, sizeof(buf)); in START_TEST()
477 ck_assert_int_eq(3, ret); in START_TEST()
481 ret = mg_url_encode("a%b/c&d.e", buf, sizeof(buf)); in START_TEST()
482 ck_assert_int_eq(15, ret); in START_TEST()
486 ret = mg_url_encode("%%%", buf, 4); in START_TEST()
487 ck_assert_int_eq(-1, ret); in START_TEST()
496 int ret; in START_TEST() local
499 ret = mg_url_decode("abc", 3, buf, sizeof(buf), 0); in START_TEST()
500 ck_assert_int_eq(ret, 3); in START_TEST()
504 ret = mg_url_decode("abcdef", 3, buf, sizeof(buf), 0); in START_TEST()
505 ck_assert_int_eq(ret, 3); in START_TEST()
509 ret = mg_url_decode("x+y", 3, buf, sizeof(buf), 0); in START_TEST()
510 ck_assert_int_eq(ret, 3); in START_TEST()
514 ret = mg_url_decode("x+y", 3, buf, sizeof(buf), 1); in START_TEST()
515 ck_assert_int_eq(ret, 3); in START_TEST()
519 ret = mg_url_decode("%25", 3, buf, sizeof(buf), 1); in START_TEST()
520 ck_assert_int_eq(ret, 1); in START_TEST()
524 ret = mg_url_decode("%20%21", 6, buf, sizeof(buf), 0); in START_TEST()
525 ck_assert_int_eq(ret, 2); in START_TEST()