Commit e579355b authored by Sergey Lyubka's avatar Sergey Lyubka

url_decode -> mg_url_decode

parent cfbaf7f1
...@@ -580,23 +580,23 @@ static void test_api_calls(void) { ...@@ -580,23 +580,23 @@ static void test_api_calls(void) {
static void test_url_decode(void) { static void test_url_decode(void) {
char buf[100]; char buf[100];
ASSERT(url_decode("foo", 3, buf, 3, 0) == -1); // No space for terminating \0 ASSERT(mg_url_decode("foo", 3, buf, 3, 0) == -1); // No space for \0
ASSERT(url_decode("foo", 3, buf, 4, 0) == 3); ASSERT(mg_url_decode("foo", 3, buf, 4, 0) == 3);
ASSERT(strcmp(buf, "foo") == 0); ASSERT(strcmp(buf, "foo") == 0);
ASSERT(url_decode("a+", 2, buf, sizeof(buf), 0) == 2); ASSERT(mg_url_decode("a+", 2, buf, sizeof(buf), 0) == 2);
ASSERT(strcmp(buf, "a+") == 0); ASSERT(strcmp(buf, "a+") == 0);
ASSERT(url_decode("a+", 2, buf, sizeof(buf), 1) == 2); ASSERT(mg_url_decode("a+", 2, buf, sizeof(buf), 1) == 2);
ASSERT(strcmp(buf, "a ") == 0); ASSERT(strcmp(buf, "a ") == 0);
ASSERT(url_decode("%61", 1, buf, sizeof(buf), 1) == 1); ASSERT(mg_url_decode("%61", 1, buf, sizeof(buf), 1) == 1);
ASSERT(strcmp(buf, "%") == 0); ASSERT(strcmp(buf, "%") == 0);
ASSERT(url_decode("%61", 2, buf, sizeof(buf), 1) == 2); ASSERT(mg_url_decode("%61", 2, buf, sizeof(buf), 1) == 2);
ASSERT(strcmp(buf, "%6") == 0); ASSERT(strcmp(buf, "%6") == 0);
ASSERT(url_decode("%61", 3, buf, sizeof(buf), 1) == 1); ASSERT(mg_url_decode("%61", 3, buf, sizeof(buf), 1) == 1);
ASSERT(strcmp(buf, "a") == 0); ASSERT(strcmp(buf, "a") == 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment