aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/main.c b/tests/main.c
index 5b697a9..4d16ad6 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -26,7 +26,17 @@ static void result_callback(QuickMediaHtmlNode *node, void *userdata) {
int main(int argc, char **argv) {
char *file_content = get_file_content("test_files/test.html");
- int result = quickmedia_html_find_nodes_xpath(file_content, "//h3[class=\"story_name\"]//a", result_callback, NULL);
+ QuickMediaHtmlSearch html_search;
+
+ int result = quickmedia_html_search_init(&html_search, file_content);
+ if(result != 0)
+ goto cleanup;
+ result = quickmedia_html_find_nodes_xpath(&html_search, "//h3[class=\"story_name\"]//a", result_callback, NULL);
+ /* Test that the object can be reused without reloading html doc */
+ result = quickmedia_html_find_nodes_xpath(&html_search, "//h3[class=\"story_name\"]//a", result_callback, NULL);
+
+ cleanup:
+ quickmedia_html_search_deinit(&html_search);
free(file_content);
return result;
}