From 0f42317438bf0f5e85a17ada1bdf755e82fadf30 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Dec 2010 15:33:06 +0000 Subject: Remove initialisation of libparserutils from tests svn path=/trunk/libcss/; revision=10962 --- test/csdetect.c | 11 ----------- test/css21.c | 4 ---- test/lex-auto.c | 4 ---- test/lex.c | 5 ----- test/parse-auto.c | 4 ---- test/parse.c | 3 --- test/parse2-auto.c | 4 ---- test/select-auto.c | 4 ---- 8 files changed, 39 deletions(-) (limited to 'test') diff --git a/test/csdetect.c b/test/csdetect.c index 8fe245d..940e357 100644 --- a/test/csdetect.c +++ b/test/csdetect.c @@ -26,13 +26,6 @@ typedef struct line_ctx { static bool handle_line(const char *data, size_t datalen, void *pw); static void run_test(const uint8_t *data, size_t len, char *expected); -static void *myrealloc(void *ptr, size_t len, void *pw) -{ - UNUSED(pw); - - return realloc(ptr, len); -} - int main(int argc, char **argv) { line_ctx ctx; @@ -42,8 +35,6 @@ int main(int argc, char **argv) return 1; } - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) return 1; @@ -71,8 +62,6 @@ int main(int argc, char **argv) free(ctx.buf); - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("PASS\n"); return 0; diff --git a/test/css21.c b/test/css21.c index 2cc68c9..cdb071f 100644 --- a/test/css21.c +++ b/test/css21.c @@ -49,8 +49,6 @@ int main(int argc, char **argv) } /* Initialise library */ - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); for (count = 0; count < ITERATIONS; count++) { @@ -149,8 +147,6 @@ int main(int argc, char **argv) css_stylesheet_destroy(sheet); } - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("PASS\n"); return 0; diff --git a/test/lex-auto.c b/test/lex-auto.c index ddd2da3..cd30819 100644 --- a/test/lex-auto.c +++ b/test/lex-auto.c @@ -59,8 +59,6 @@ int main(int argc, char **argv) return 1; } - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) return 1; @@ -88,8 +86,6 @@ int main(int argc, char **argv) free(ctx.buf); - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("PASS\n"); return 0; diff --git a/test/lex.c b/test/lex.c index 96c36dc..ba51f97 100644 --- a/test/lex.c +++ b/test/lex.c @@ -136,9 +136,6 @@ int main(int argc, char **argv) return 1; } - /* Initialise library */ - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - for (i = 0; i < ITERATIONS; i++) { assert(parserutils_inputstream_create("UTF-8", CSS_CHARSET_DICTATED,css_charset_extract, @@ -203,8 +200,6 @@ int main(int argc, char **argv) parserutils_inputstream_destroy(stream); } - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("PASS\n"); return 0; diff --git a/test/parse-auto.c b/test/parse-auto.c index 77405c0..55a817e 100644 --- a/test/parse-auto.c +++ b/test/parse-auto.c @@ -111,8 +111,6 @@ int main(int argc, char **argv) return 1; } - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) return 1; @@ -143,8 +141,6 @@ int main(int argc, char **argv) free(ctx.buf); - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("INFO: Counter is %zu\n", counter); lwc_iterate_strings(printing_lwc_iterator, NULL); diff --git a/test/parse.c b/test/parse.c index 9e28c3d..b42356d 100644 --- a/test/parse.c +++ b/test/parse.c @@ -91,7 +91,6 @@ int main(int argc, char **argv) } /* Initialise library */ - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); for (i = 0; i < ITERATIONS; i++) { @@ -141,8 +140,6 @@ int main(int argc, char **argv) } - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("PASS\n"); return 0; diff --git a/test/parse2-auto.c b/test/parse2-auto.c index 0305b4c..b815a8c 100644 --- a/test/parse2-auto.c +++ b/test/parse2-auto.c @@ -84,8 +84,6 @@ int main(int argc, char **argv) return 1; } - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) return 1; @@ -116,8 +114,6 @@ int main(int argc, char **argv) free(ctx.buf); - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("INFO: Counter is %zu\n", counter); lwc_iterate_strings(printing_lwc_iterator, NULL); diff --git a/test/select-auto.c b/test/select-auto.c index d09162a..a5a8e91 100644 --- a/test/select-auto.c +++ b/test/select-auto.c @@ -212,8 +212,6 @@ int main(int argc, char **argv) printf("css_hint: %u\n", (int) sizeof(css_hint)); printf("computed: %u\n", (int) sizeof(css_computed_style)); - assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); - memset(&ctx, 0, sizeof(ctx)); assert(lwc_initialise(counting_realloc, &counter, 0) == lwc_error_ok); @@ -238,8 +236,6 @@ int main(int argc, char **argv) assert(counter == 2); - assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); - printf("PASS\n"); return 0; } -- cgit v1.2.3