51 const struct test list1[]={
55 {
"%6 1", 4,
"%6 1", 4},
58 {
"%6%a", 4,
"%6%a", 4},
60 {
"%FF", 0,
"\xff", 1},
61 {
"%FF%00%ff", 9,
"\xff\x00\xff", 3},
70 {
"a=b", 3,
"a%3Db", 5},
71 {
"a=b", 0,
"a%3Db", 5},
73 {
"a=b", 2,
"a%3D", 4},
74 {
"1/./0", 5,
"1%2F.%2F0", 9},
75 {
"-._~!#%&", 0,
"-._~%21%23%25%26", 16},
77 {
"a\xff\x01g", 4,
"a%FF%01g", 8},
84 for(i = 0; list1[
i].
in; i++) {
91 fail_unless(outlen == list1[i].outlen,
"wrong output length returned");
92 fail_unless(!memcmp(out, list1[i].out, list1[i].outlen),
93 "bad output data returned");
95 printf(
"curl_easy_unescape test %d DONE\n", i);
100 for(i = 0; list2[
i].
in; i++) {
105 outlen = (int)strlen(out);
106 fail_unless(outlen == list2[i].outlen,
"wrong output length returned");
107 fail_unless(!memcmp(out, list2[i].out, list2[i].outlen),
108 "bad output data returned");
110 printf(
"curl_easy_escape test %d DONE (%s)\n", i, out);
CURL_EXTERN void curl_free(void *p)
abort_unless(hnd!=NULL,"returned NULL!")
static void unit_stop(void)
CURL_EXTERN char * curl_easy_escape(CURL *handle, const char *string, int length)
static CURLcode unit_setup(void)
#define fail_unless(expr, msg)
CURL_EXTERN CURL * curl_easy_init(void)
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
const struct test list2[]
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...
CURL_EXTERN char * curl_easy_unescape(CURL *handle, const char *string, int length, int *outlength)