diff options
Diffstat (limited to 'test/number.c')
-rw-r--r-- | test/number.c | 8 |
1 files changed, 3 insertions, 5 deletions
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) |