summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-06-29 23:06:53 +0100
committerVincent Sanders <vince@kyllikki.org>2016-06-29 23:06:53 +0100
commitc313524998377db92e5387d209e1ea79fbc30ba6 (patch)
tree2d227e6d617fc98fbc4b0ad36a7870a63cc3f900 /test
parentc523bb47a0c884f58ab267eb9ad699ccbed907d5 (diff)
downloadnetsurf-c313524998377db92e5387d209e1ea79fbc30ba6.tar.gz
netsurf-c313524998377db92e5387d209e1ea79fbc30ba6.tar.bz2
reduce curl usage to fetcher, url unescaping and time parsing
Diffstat (limited to 'test')
-rw-r--r--test/Makefile2
-rw-r--r--test/llcache.c14
-rw-r--r--test/urldbtest.c2
3 files changed, 8 insertions, 10 deletions
diff --git a/test/Makefile b/test/Makefile
index 66b8aa78e..9fdb3f210 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -80,7 +80,7 @@ TESTCFLAGS := -std=c99 -g -Wall \
-D_BSD_SOURCE \
-D_POSIX_C_SOURCE=200809L \
-D_XOPEN_SOURCE=600 \
- -Itest -Iinclude -Ifrontends -I. -I.. \
+ -Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
-Dnsgtk \
$(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc libidn) \
$(LIB_CFLAGS) \
diff --git a/test/llcache.c b/test/llcache.c
index 850f0608c..df51386a5 100644
--- a/test/llcache.c
+++ b/test/llcache.c
@@ -20,8 +20,6 @@
#include <stdlib.h>
#include <string.h>
-#include <curl/curl.h>
-
#include "content/fetch.h"
#include "content/llcache.h"
#include "utils/ring.h"
@@ -94,12 +92,14 @@ char *path_to_url(const char *path)
/* utils/url.h */
char *url_to_path(const char *url)
{
- char *url_path = curl_unescape(url, 0);
- char *path;
+ char *url_path;
+ char *path = NULL;
- /* return the absolute path including leading / */
- path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1));
- curl_free(url_path);
+ if (url_unescape(url, 0, &url_path) == NSERROR_OK) {
+ /* return the absolute path including leading / */
+ path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1));
+ free(url_path);
+ }
return path;
}
diff --git a/test/urldbtest.c b/test/urldbtest.c
index 2d14c0fbb..338ce1f66 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -27,8 +27,6 @@
#include <strings.h>
#include <time.h>
-#include <curl/curl.h>
-
#include "utils/errors.h"
#include "utils/nsurl.h"
#include "netsurf/bitmap.h"