From 7737a59d775aeb6dc14868fef6b2c95ed948d17f Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Dec 2010 15:55:55 +0000 Subject: Remove use of lwc_initialise and also parserutils.h includes. r=vince svn path=/trunk/libcss/; revision=10964 --- test/csdetect.c | 1 - test/css21.c | 4 ---- test/lex-auto.c | 1 - test/lex.c | 1 - test/number.c | 9 --------- test/parse-auto.c | 19 ------------------- test/parse.c | 4 ---- test/parse2-auto.c | 19 ------------------- test/select-auto.c | 19 ------------------- 9 files changed, 77 deletions(-) (limited to 'test') diff --git a/test/csdetect.c b/test/csdetect.c index 940e357..d12d6cf 100644 --- a/test/csdetect.c +++ b/test/csdetect.c @@ -4,7 +4,6 @@ #include #include -#include #include #include diff --git a/test/css21.c b/test/css21.c index cdb071f..774c58a 100644 --- a/test/css21.c +++ b/test/css21.c @@ -1,7 +1,6 @@ #include #include -#include #include #include "stylesheet.h" @@ -48,9 +47,6 @@ int main(int argc, char **argv) return 1; } - /* Initialise library */ - 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], diff --git a/test/lex-auto.c b/test/lex-auto.c index cd30819..08d84c6 100644 --- a/test/lex-auto.c +++ b/test/lex-auto.c @@ -4,7 +4,6 @@ #include #include -#include #include #include diff --git a/test/lex.c b/test/lex.c index ba51f97..c48feeb 100644 --- a/test/lex.c +++ b/test/lex.c @@ -1,7 +1,6 @@ #include #include -#include #include #include diff --git a/test/number.c b/test/number.c index ca9ddb5..392d9ef 100644 --- a/test/number.c +++ b/test/number.c @@ -8,13 +8,6 @@ #include "testutils.h" -static void *myrealloc(void *ptr, size_t len, void *pw) -{ - UNUSED(pw); - - return realloc(ptr, len); -} - typedef struct line_ctx { size_t buflen; size_t bufused; @@ -58,8 +51,6 @@ 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 */ diff --git a/test/parse-auto.c b/test/parse-auto.c index 55a817e..2196a94 100644 --- a/test/parse-auto.c +++ b/test/parse-auto.c @@ -5,7 +5,6 @@ #include #include -#include #include #include "stylesheet.h" @@ -69,18 +68,6 @@ static void *myrealloc(void *data, size_t len, void *pw) return realloc(data, len); } -static void *counting_realloc(void *data, size_t len, void *pw) -{ - size_t *counter = (size_t *)pw; - - if (data == NULL) - *counter += 1; - else if (len == 0) - *counter -= 1; - - return realloc(data, len); -} - static css_error resolve_url(void *pw, const char *base, lwc_string *rel, lwc_string **abs) { @@ -104,7 +91,6 @@ printing_lwc_iterator(lwc_string *str, void *pw) int main(int argc, char **argv) { line_ctx ctx; - size_t counter = 0; if (argc != 3) { printf("Usage: %s \n", argv[0]); @@ -131,8 +117,6 @@ int main(int argc, char **argv) ctx.inerrors = false; ctx.inexp = false; - assert(lwc_initialise(counting_realloc, &counter, 0) == lwc_error_ok); - assert(parse_testfile(argv[2], handle_line, &ctx) == true); /* and run final test */ @@ -141,11 +125,8 @@ int main(int argc, char **argv) free(ctx.buf); - printf("INFO: Counter is %zu\n", counter); lwc_iterate_strings(printing_lwc_iterator, NULL); - assert(counter == 2); - printf("PASS\n"); return 0; diff --git a/test/parse.c b/test/parse.c index b42356d..03a9703 100644 --- a/test/parse.c +++ b/test/parse.c @@ -1,7 +1,6 @@ #include #include -#include #include #include "charset/detect.h" @@ -90,9 +89,6 @@ int main(int argc, char **argv) return 1; } - /* Initialise library */ - assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); - for (i = 0; i < ITERATIONS; i++) { assert(css_parser_create("UTF-8", CSS_CHARSET_DICTATED, myrealloc, NULL, &parser) == CSS_OK); diff --git a/test/parse2-auto.c b/test/parse2-auto.c index b815a8c..e64b169 100644 --- a/test/parse2-auto.c +++ b/test/parse2-auto.c @@ -5,7 +5,6 @@ #include #include -#include #include #include "utils/utils.h" @@ -42,18 +41,6 @@ static void *myrealloc(void *data, size_t len, void *pw) return realloc(data, len); } -static void *counting_realloc(void *data, size_t len, void *pw) -{ - size_t *counter = (size_t *)pw; - - if (data == NULL) - *counter += 1; - else if (len == 0) - *counter -= 1; - - return realloc(data, len); -} - static css_error resolve_url(void *pw, const char *base, lwc_string *rel, lwc_string **abs) { @@ -77,7 +64,6 @@ printing_lwc_iterator(lwc_string *str, void *pw) int main(int argc, char **argv) { line_ctx ctx; - size_t counter = 0; if (argc != 3) { printf("Usage: %s \n", argv[0]); @@ -104,8 +90,6 @@ int main(int argc, char **argv) ctx.inerrors = false; ctx.inexp = false; - assert(lwc_initialise(counting_realloc, &counter, 0) == lwc_error_ok); - assert(parse_testfile(argv[2], handle_line, &ctx) == true); /* and run final test */ @@ -114,10 +98,7 @@ int main(int argc, char **argv) free(ctx.buf); - printf("INFO: Counter is %zu\n", counter); lwc_iterate_strings(printing_lwc_iterator, NULL); - - assert(counter == 2); printf("PASS\n"); diff --git a/test/select-auto.c b/test/select-auto.c index a5a8e91..ff9de09 100644 --- a/test/select-auto.c +++ b/test/select-auto.c @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -167,18 +166,6 @@ static void *myrealloc(void *data, size_t len, void *pw) return realloc(data, len); } -static void *counting_realloc(void *data, size_t len, void *pw) -{ - size_t *counter = (size_t *)pw; - - if (data == NULL) - *counter += 1; - else if (len == 0) - *counter -= 1; - - return realloc(data, len); -} - static css_error resolve_url(void *pw, const char *base, lwc_string *rel, lwc_string **abs) { @@ -202,7 +189,6 @@ printing_lwc_iterator(lwc_string *str, void *pw) int main(int argc, char **argv) { line_ctx ctx; - size_t counter = 0; if (argc != 3) { printf("Usage: %s \n", argv[0]); @@ -214,8 +200,6 @@ int main(int argc, char **argv) memset(&ctx, 0, sizeof(ctx)); - assert(lwc_initialise(counting_realloc, &counter, 0) == lwc_error_ok); - lwc_intern_string("class", SLEN("class"), &ctx.attr_class); lwc_intern_string("id", SLEN("id"), &ctx.attr_id); @@ -231,11 +215,8 @@ int main(int argc, char **argv) lwc_string_unref(ctx.attr_class); lwc_string_unref(ctx.attr_id); - printf("INFO: Counter is %zu\n", counter); lwc_iterate_strings(printing_lwc_iterator, NULL); - assert(counter == 2); - printf("PASS\n"); return 0; } -- cgit v1.2.3