Added check for results in example selectors_low_level https://github.com/lexborisov/Modest/issues/5

This commit is contained in:
lexborisov 2016-11-21 19:55:45 +03:00
parent 4b2dfdb4c8
commit cad3ee5404

View File

@ -93,12 +93,19 @@ int main(int argc, const char * argv[])
mycss_selectors_serialization_list(mycss_entry_selectors(css_entry), list, serialization_callback, NULL); mycss_selectors_serialization_list(mycss_entry_selectors(css_entry), list, serialization_callback, NULL);
fprintf(stdout, "\n"); fprintf(stdout, "\n");
printf("\nFound result:\n"); if(collection) {
for(size_t i = 0; i < collection->length; i++) { printf("\nFound result:\n");
fprintf(stdout, "\t");
myhtml_tree_print_node(html_tree, collection->list[i], stdout); for(size_t i = 0; i < collection->length; i++) {
fprintf(stdout, "\t");
myhtml_tree_print_node(html_tree, collection->list[i], stdout);
}
fprintf(stdout, "\n");
}
else {
printf("\nFound result: empty\n");
} }
fprintf(stdout, "\n");
// destroy all // destroy all
mycss_selectors_list_destroy(mycss_entry_selectors(css_entry), list, true); mycss_selectors_list_destroy(mycss_entry_selectors(css_entry), list, true);