From 80cfe125983eb126a9f8afd974196cf0bf347877 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 27 Mar 2010 16:10:57 +0000 Subject: Fix libcss to use new libwapcaplet behaviour. TODO: update the tests to include a refcounting proof svn path=/trunk/libcss/; revision=10162 --- test/parse2-auto.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'test/parse2-auto.c') diff --git a/test/parse2-auto.c b/test/parse2-auto.c index 2a89ef4..c9f37ab 100644 --- a/test/parse2-auto.c +++ b/test/parse2-auto.c @@ -41,14 +41,14 @@ static void *myrealloc(void *data, size_t len, void *pw) return realloc(data, 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; } @@ -84,6 +84,8 @@ int main(int argc, char **argv) ctx.inerrors = false; ctx.inexp = false; + assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); + assert(parse_testfile(argv[2], handle_line, &ctx) == true); /* and run final test */ @@ -176,7 +178,6 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) char *buf; size_t buflen; static int testnum; - lwc_context *ctx; buf = malloc(2 * explen); if (buf == NULL) { @@ -184,11 +185,8 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) } buflen = 2 * explen; - assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok); - lwc_context_ref(ctx); - assert(css_stylesheet_create(CSS_LEVEL_21, "UTF-8", "foo", NULL, - false, false, ctx, myrealloc, NULL, resolve_url, NULL, + false, false, myrealloc, NULL, resolve_url, NULL, &sheet) == CSS_OK); error = css_stylesheet_append_data(sheet, data, len); @@ -212,7 +210,7 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) } css_stylesheet_destroy(sheet); - lwc_context_unref(ctx); + printf("Test %d: PASS\n", testnum); } -- cgit v1.2.3