diff --git a/test/Makefile b/test/Makefile index babde6e65..6e1c2d3f0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -2,18 +2,19 @@ CFLAGS := -std=c99 -g -O0 -D_BSD_SOURCE -D_POSIX_C_SOURCE -I.. \ `pkg-config --cflags libxml-2.0 libcurl` LDFLAGS := `pkg-config --libs libxml-2.0 libcurl` -llcache_CFLAGS := `pkg-config --cflags libparserutils` -llcache_LDFLAGS := `pkg-config --libs libparserutils` +llcache_CFLAGS := `pkg-config --cflags libparserutils libwapcaplet` +llcache_LDFLAGS := `pkg-config --libs libparserutils libwapcaplet` llcache_SRCS := content/fetch.c content/fetchers/fetch_curl.c \ content/fetchers/fetch_data.c content/llcache.c \ content/urldb.c desktop/options.c desktop/version.c \ - utils/base64.c utils/hashtable.c utils/messages.c \ - utils/url.c utils/useragent.c utils/utf8.c utils/utils.c \ - test/llcache.c + utils/base64.c utils/hashtable.c utils/log.c \ + utils/messages.c utils/url.c utils/useragent.c utils/utf8.c \ + utils/utils.c test/llcache.c -urldbtest_SRCS := content/urldb.c utils/url.c utils/utils.c utils/messages.c \ - utils/hashtable.c utils/filename.c test/urldbtest.c +urldbtest_SRCS := content/urldb.c utils/url.c utils/utils.c utils/log.c \ + utils/messages.c utils/hashtable.c utils/filename.c \ + test/urldbtest.c urldbtest_CFLAGS := -O2 urldbtest_LDFLAGS := diff --git a/test/llcache.c b/test/llcache.c index b7b6fd05c..416c2f573 100644 --- a/test/llcache.c +++ b/test/llcache.c @@ -99,11 +99,19 @@ char *url_to_path(const char *url) * * URLdb should have a cookies update event + handler registration */ -bool cookies_update(const char *domain, const struct cookie_data *data) +bool cookies_schedule_update(const struct cookie_data *data) { return true; } +/* desktop/cookies.h -- used by urldb + * + * URLdb should have a cookies removal handler registration + */ +void cookies_remove(const struct cookie_data *data) +{ +} + /* image/bitmap.h -- used by urldb * * URLdb shouldn't care about bitmaps. @@ -113,33 +121,14 @@ void bitmap_destroy(void *bitmap) { } -/* desktop/tree.h -- used by options.c +/* content/fetchers/fetch_file.h -- used by fetcher core * - * Why on earth is tree loading and saving in options.c? + * Simpler to stub this than haul in all the file fetcher's dependencies */ -void tree_initialise(struct tree *tree) +void fetch_file_register(void) { } -/* desktop/tree.h */ -struct node *tree_create_folder_node(struct node *parent, const char *title) -{ - return NULL; -} - -/* desktop/tree.h */ -struct node *tree_create_URL_node(struct node *parent, const char *url, - const struct url_data *data, const char *title) -{ - return NULL; -} - -/* desktop/tree.h */ -struct node_element *tree_find_element(struct node *node, node_element_data d) -{ - return NULL; -} - /****************************************************************************** * test: protocol handler * ******************************************************************************/ diff --git a/test/urldbtest.c b/test/urldbtest.c index dfb3b6ea5..6fcc58658 100644 --- a/test/urldbtest.c +++ b/test/urldbtest.c @@ -46,11 +46,15 @@ int option_expire_url = 0; bool verbose_log = true; -bool cookies_update(const char *domain, const struct cookie_data *data) +bool cookies_schedule_update(const struct cookie_data *data) { return true; } +void cookies_remove(const struct cookie_data *data) +{ +} + void die(const char *error) { printf("die: %s\n", error); @@ -172,6 +176,9 @@ int main(void) assert(urldb_add_url("http://www2.2checkout.com/")); assert(urldb_get_url("http://www2.2checkout.com/")); +// assert(urldb_add_url("http://2.bp.blogspot.com/_448y6kVhntg/TSekubcLJ7I/AAAAAAAAHJE/yZTsV5xT5t4/s1600/covers.jpg")); +// assert(urldb_get_url("http://2.bp.blogspot.com/_448y6kVhntg/TSekubcLJ7I/AAAAAAAAHJE/yZTsV5xT5t4/s1600/covers.jpg")); + /* Valid path */ assert(urldb_set_cookie("name=value;Path=/\r\n", "http://www.google.com/", NULL));