aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/main.c b/tests/main.c
index 6d84cfa..de37c9a 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -23,10 +23,10 @@ char* file_get_content(const char *path, long *filesize) {
static void html_parse_callback(HtmlParser *html_parser, HtmlParseType parse_type, void *userdata_any) {
switch(parse_type) {
case HTML_PARSE_TAG_START:
- printf("tag start: %.*s\n", html_parser->tag_name.size, html_parser->tag_name.data);
+ printf("tag start: %.*s\n", (int)html_parser->tag_name.size, html_parser->tag_name.data);
break;
case HTML_PARSE_TAG_END:
- printf("tag end: %.*s\n", html_parser->tag_name.size, html_parser->tag_name.data);
+ printf("tag end: %.*s\n", (int)html_parser->tag_name.size, html_parser->tag_name.data);
break;
}
}
@@ -39,10 +39,7 @@ int main() {
return 1;
}
- HtmlParser html_parser;
- html_parser_init(&html_parser, file_data, filesize, html_parse_callback, NULL);
- html_parser_parse(&html_parser);
- html_parser_deinit(&html_parser);
+ html_parser_parse(file_data, filesize, html_parse_callback, NULL);
free(file_data);
return 0;
}