summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/csdetect.c1
-rw-r--r--test/css21.c4
-rw-r--r--test/lex-auto.c1
-rw-r--r--test/lex.c1
-rw-r--r--test/number.c9
-rw-r--r--test/parse-auto.c19
-rw-r--r--test/parse.c4
-rw-r--r--test/parse2-auto.c19
-rw-r--r--test/select-auto.c19
9 files changed, 0 insertions, 77 deletions
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 <stdlib.h>
#include <string.h>
-#include <parserutils/parserutils.h>
#include <parserutils/charset/mibenum.h>
#include <libcss/libcss.h>
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 <inttypes.h>
#include <stdio.h>
-#include <parserutils/parserutils.h>
#include <libcss/libcss.h>
#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 <stdlib.h>
#include <string.h>
-#include <parserutils/parserutils.h>
#include <parserutils/input/inputstream.h>
#include <libcss/libcss.h>
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 <inttypes.h>
#include <stdio.h>
-#include <parserutils/parserutils.h>
#include <parserutils/charset/utf8.h>
#include <parserutils/input/inputstream.h>
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 <stdlib.h>
#include <string.h>
-#include <parserutils/parserutils.h>
#include <libcss/libcss.h>
#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 <aliases_file> <filename>\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 <inttypes.h>
#include <stdio.h>
-#include <parserutils/parserutils.h>
#include <libcss/libcss.h>
#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 <stdlib.h>
#include <string.h>
-#include <parserutils/parserutils.h>
#include <libcss/libcss.h>
#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 <aliases_file> <filename>\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 <stdlib.h>
#include <string.h>
-#include <parserutils/parserutils.h>
#include <libcss/libcss.h>
#include <libcss/computed.h>
#include <libcss/select.h>
@@ -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 <aliases_file> <filename>\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;
}