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/number.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test/number.c') diff --git a/test/number.c b/test/number.c index 7bb57c3..ca9ddb5 100644 --- a/test/number.c +++ b/test/number.c @@ -58,6 +58,8 @@ int main(int argc, char **argv) ctx.indata = 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 */ @@ -118,7 +120,6 @@ bool handle_line(const char *data, size_t datalen, void *pw) void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) { lwc_string *in; - lwc_context *ctx; size_t consumed; css_fixed result; char buf[256]; @@ -126,9 +127,7 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) UNUSED(exp); UNUSED(explen); - assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok); - lwc_context_ref(ctx); - assert(lwc_context_intern(ctx, (const char *)data, len, &in) == lwc_error_ok); + assert(lwc_intern_string((const char *)data, len, &in) == lwc_error_ok); result = number_from_lwc_string(in, false, &consumed); @@ -137,7 +136,6 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) printf("got: %s expected: %.*s\n", buf, (int) explen, exp); assert(strncmp(buf, exp, explen) == 0); - lwc_context_unref(ctx); } void print_css_fixed(char *buf, size_t len, css_fixed f) -- cgit v1.2.3