diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-27 16:10:57 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-27 16:10:57 +0000 |
commit | 80cfe125983eb126a9f8afd974196cf0bf347877 (patch) | |
tree | e6fe993a7ad2fc6859509b661d2d4f721e846e60 /test/css21.c | |
parent | 46e3a946d7b2f7d68f3753a37c6f68a732a36f01 (diff) | |
download | libcss-80cfe125983eb126a9f8afd974196cf0bf347877.tar.gz |
Fix libcss to use new libwapcaplet behaviour.
TODO: update the tests to include a refcounting proof
svn path=/trunk/libcss/; revision=10162
Diffstat (limited to 'test/css21.c')
-rw-r--r-- | test/css21.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/css21.c b/test/css21.c index 5e6c71a..f969603 100644 --- a/test/css21.c +++ b/test/css21.c @@ -20,14 +20,14 @@ static void *myrealloc(void *ptr, size_t len, void *pw) return realloc(ptr, len); } -static css_error resolve_url(void *pw, lwc_context *dict, +static css_error resolve_url(void *pw, const char *base, lwc_string *rel, lwc_string **abs) { UNUSED(pw); UNUSED(base); /* About as useless as possible */ - *abs = lwc_context_string_ref(dict, rel); + *abs = lwc_string_ref(rel); return CSS_OK; } @@ -40,7 +40,6 @@ int main(int argc, char **argv) #define CHUNK_SIZE (4096) uint8_t buf[CHUNK_SIZE]; css_error error; - lwc_context *ctx; int count; if (argc != 3) { @@ -51,14 +50,12 @@ int main(int argc, char **argv) /* Initialise library */ assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); - assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok); - - lwc_context_ref(ctx); /* Transform weak ref to a strong ref */ + assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); for (count = 0; count < ITERATIONS; count++) { assert(css_stylesheet_create(CSS_LEVEL_21, "UTF-8", argv[2], - NULL, false, false, ctx, myrealloc, NULL, + NULL, false, false, myrealloc, NULL, resolve_url, NULL, &sheet) == CSS_OK); fp = fopen(argv[2], "rb"); @@ -114,7 +111,7 @@ int main(int argc, char **argv) buf[lwc_string_length(url)] = '\0'; assert(css_stylesheet_create(CSS_LEVEL_21, - "UTF-8", buf, NULL, false, false, ctx, + "UTF-8", buf, NULL, false, false, myrealloc, NULL, resolve_url, NULL, &import) == CSS_OK); @@ -153,8 +150,6 @@ int main(int argc, char **argv) printf("PASS\n"); - lwc_context_unref(ctx); - return 0; } |