2 * Copyright (C) 2010-2011 jeanfi@gmail.com
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #include "../src/lib/url.h"
28 int test_url_encode(char *url, char *ref_url)
33 res_url = url_encode(url);
35 if (strcmp(ref_url, res_url)) {
37 "FAILURE: url_encode(%s) returns %s instead of %s\n",
38 url, res_url, ref_url);
49 int tests_url_encode()
55 if (!test_url_encode("abcdef12345", "abcdef12345"))
58 if (!test_url_encode("a b", "a%20b"))
61 if (!test_url_encode("ab-_.~", "ab-_.~"))
68 int main(int argc, char **argv)
74 failures += tests_url_encode();