Branch Coverage

src/pdfmake_outline.c
Criterion Covered Total %
branch 47 112 41.9


line true false branch
109 0 11 if (dest.page_index >= doc->page_count) {
122 0 1 pdfmake_array_push(arena, &arr, (dest.left == 0) ? pdfmake_null() : pdfmake_real(dest.left));
123 0 1 pdfmake_array_push(arena, &arr, (dest.top == 0) ? pdfmake_null() : pdfmake_real(dest.top));
124 0 1 pdfmake_array_push(arena, &arr, (dest.zoom == 0) ? pdfmake_null() : pdfmake_real(dest.zoom));
177 0 27 if (!item) return NULL;
183 27 0 if (title) {
186 0 27 if (!item->title) return NULL;
204 13 17 while (item) {
206 20 13 for (child = item->first; child; child = child->next) {
208 20 0 if (child->open && child->count > 0) {
0 20 if (child->open && child->count > 0) {
230 0 163 if (!doc) return NULL;
240 0 17 if (!doc) return NULL;
242 3 14 if (doc->outline_root) {
248 0 14 if (!root) return NULL;
260 13 0 if (!parent || !parent->doc) return NULL;
0 13 if (!parent || !parent->doc) return NULL;
263 0 13 if (!child) return NULL;
268 8 5 if (!parent->first) {
287 0 0 if (!item || !title) return PDFMAKE_EINVAL;
0 0 if (!item || !title) return PDFMAKE_EINVAL;
292 0 0 if (item->title && strlen(item->title) >= new_len) {
0 0 if (item->title && strlen(item->title) >= new_len) {
304 0 0 if (!item) return PDFMAKE_EINVAL;
311 0 4 if (!item) return;
320 0 0 if (!item || !item->parent) return PDFMAKE_EINVAL;
0 0 if (!item || !item->parent) return PDFMAKE_EINVAL;
325 0 0 if (item->prev) {
331 0 0 if (item->next) {
348 0 0 if (!root) return 0;
351 0 0 for (child = root->first; child; child = child->next) {
378 11 0 if (item->title) {
389 11 0 if (item->title) { /* Only add dest if this is a real item, not root container */
400 4 7 if (item->first) {
403 6 4 for (child = item->first; child; child = child->next) {
405 4 2 if (!first_num) first_num = child_num;
410 6 4 for (child = item->first; child; child = child->next) {
412 6 0 if (child_obj) {
413 2 4 if (child->prev) {
417 2 4 if (child->next) {
432 4 7 if (item->count > 0) {
434 4 0 int count_val = item->open ? item->count : -item->count;
440 11 0 if (obj_ptr) {
460 5 0 if (!doc || !root) return 0;
0 5 if (!doc || !root) return 0;
473 5 0 if (root->title) {
482 5 0 if (outlines_ptr) {
487 0 0 } else if (root->first) {
492 0 0 for (child = root->first; child; child = child->next) {
494 0 0 if (!first_num) first_num = child_num;
497 0 0 if (child->open) total_count += child->count;
501 0 0 for (child = root->first; child; child = child->next) {
503 0 0 if (child_obj) {
504 0 0 if (child->prev) {
508 0 0 if (child->next) {
520 0 0 if (outlines_ptr) {