summaryrefslogtreecommitdiff
path: root/test/number.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2010-03-27 16:10:57 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2010-03-27 16:10:57 +0000
commit80cfe125983eb126a9f8afd974196cf0bf347877 (patch)
treee6fe993a7ad2fc6859509b661d2d4f721e846e60 /test/number.c
parent46e3a946d7b2f7d68f3753a37c6f68a732a36f01 (diff)
downloadlibcss-80cfe125983eb126a9f8afd974196cf0bf347877.tar.gz
libcss-80cfe125983eb126a9f8afd974196cf0bf347877.tar.bz2
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/number.c')
-rw-r--r--test/number.c8
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)