From 7af44e1552d41fc04ba5243e619a03c222c07c9f Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 4 Dec 2010 13:28:52 +0000 Subject: Remove libcss_initialise/finalise. Fix testsuite to compile (it passes, too) svn path=/trunk/libcss/; revision=10955 --- test/INDEX | 1 - test/Makefile | 2 +- test/csdetect.c | 5 +++-- test/css21.c | 5 +++-- test/lex-auto.c | 5 +++-- test/lex.c | 5 +++-- test/libcss.c | 29 ----------------------------- test/parse-auto.c | 5 +++-- test/parse.c | 5 +++-- test/parse2-auto.c | 5 +++-- test/select-auto.c | 5 +++-- 11 files changed, 25 insertions(+), 47 deletions(-) delete mode 100644 test/libcss.c (limited to 'test') diff --git a/test/INDEX b/test/INDEX index 6bf6228..b519b1f 100644 --- a/test/INDEX +++ b/test/INDEX @@ -2,7 +2,6 @@ # # Test Description DataDir -libcss Library initialisation/finalisation csdetect Character set detection csdetect #lex Lexing css lex-auto Automated lexer tests lex diff --git a/test/Makefile b/test/Makefile index eda595d..64257ef 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,6 +1,6 @@ # Tests DIR_TEST_ITEMS := csdetect:csdetect.c css21:css21.c lex:lex.c \ - lex-auto:lex-auto.c libcss:libcss.c number:number.c \ + lex-auto:lex-auto.c number:number.c \ parse:parse.c parse-auto:parse-auto.c parse2-auto:parse2-auto.c \ select-auto:select-auto.c diff --git a/test/csdetect.c b/test/csdetect.c index c452b5b..8fe245d 100644 --- a/test/csdetect.c +++ b/test/csdetect.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -41,7 +42,7 @@ int main(int argc, char **argv) return 1; } - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) @@ -70,7 +71,7 @@ int main(int argc, char **argv) free(ctx.buf); - assert(css_finalise(myrealloc, NULL) == CSS_OK); + assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); printf("PASS\n"); diff --git a/test/css21.c b/test/css21.c index 14217e7..2cc68c9 100644 --- a/test/css21.c +++ b/test/css21.c @@ -1,6 +1,7 @@ #include #include +#include #include #include "stylesheet.h" @@ -48,7 +49,7 @@ int main(int argc, char **argv) } /* Initialise library */ - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); @@ -148,7 +149,7 @@ int main(int argc, char **argv) css_stylesheet_destroy(sheet); } - assert(css_finalise(myrealloc, NULL) == CSS_OK); + assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); printf("PASS\n"); diff --git a/test/lex-auto.c b/test/lex-auto.c index 65118d6..ddd2da3 100644 --- a/test/lex-auto.c +++ b/test/lex-auto.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -58,7 +59,7 @@ int main(int argc, char **argv) return 1; } - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) @@ -87,7 +88,7 @@ int main(int argc, char **argv) free(ctx.buf); - assert(css_finalise(myrealloc, NULL) == CSS_OK); + assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); printf("PASS\n"); diff --git a/test/lex.c b/test/lex.c index 29326d0..96c36dc 100644 --- a/test/lex.c +++ b/test/lex.c @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -136,7 +137,7 @@ int main(int argc, char **argv) } /* Initialise library */ - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); for (i = 0; i < ITERATIONS; i++) { assert(parserutils_inputstream_create("UTF-8", @@ -202,7 +203,7 @@ int main(int argc, char **argv) parserutils_inputstream_destroy(stream); } - assert(css_finalise(myrealloc, NULL) == CSS_OK); + assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); printf("PASS\n"); diff --git a/test/libcss.c b/test/libcss.c deleted file mode 100644 index 5f2e82e..0000000 --- a/test/libcss.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include - -#include "testutils.h" - -static void *myrealloc(void *ptr, size_t len, void *pw) -{ - UNUSED(pw); - - return realloc(ptr, len); -} - -int main(int argc, char **argv) -{ - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - return 1; - } - - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); - - assert (css_finalise(myrealloc, NULL) == CSS_OK); - - printf("PASS\n"); - - return 0; -} diff --git a/test/parse-auto.c b/test/parse-auto.c index c15f572..77405c0 100644 --- a/test/parse-auto.c +++ b/test/parse-auto.c @@ -5,6 +5,7 @@ #include #include +#include #include #include "stylesheet.h" @@ -110,7 +111,7 @@ int main(int argc, char **argv) return 1; } - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) @@ -142,7 +143,7 @@ int main(int argc, char **argv) free(ctx.buf); - assert(css_finalise(myrealloc, NULL) == CSS_OK); + 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 3618f34..9e28c3d 100644 --- a/test/parse.c +++ b/test/parse.c @@ -1,6 +1,7 @@ #include #include +#include #include #include "charset/detect.h" @@ -90,7 +91,7 @@ int main(int argc, char **argv) } /* Initialise library */ - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok); for (i = 0; i < ITERATIONS; i++) { @@ -140,7 +141,7 @@ int main(int argc, char **argv) } - assert(css_finalise(myrealloc, NULL) == CSS_OK); + assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); printf("PASS\n"); diff --git a/test/parse2-auto.c b/test/parse2-auto.c index f00c272..0305b4c 100644 --- a/test/parse2-auto.c +++ b/test/parse2-auto.c @@ -5,6 +5,7 @@ #include #include +#include #include #include "utils/utils.h" @@ -83,7 +84,7 @@ int main(int argc, char **argv) return 1; } - assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); ctx.buflen = parse_filesize(argv[2]); if (ctx.buflen == 0) @@ -115,7 +116,7 @@ int main(int argc, char **argv) free(ctx.buf); - assert(css_finalise(myrealloc, NULL) == CSS_OK); + 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 3768f68..d09162a 100644 --- a/test/select-auto.c +++ b/test/select-auto.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -211,7 +212,7 @@ 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(css_initialise(argv[1], myrealloc, NULL) == CSS_OK); + assert(parserutils_initialise(argv[1], myrealloc, NULL) == PARSERUTILS_OK); memset(&ctx, 0, sizeof(ctx)); @@ -237,7 +238,7 @@ int main(int argc, char **argv) assert(counter == 2); - assert(css_finalise(myrealloc, NULL) == CSS_OK); + assert(parserutils_finalise(myrealloc, NULL) == PARSERUTILS_OK); printf("PASS\n"); return 0; -- cgit v1.2.3