Branch Coverage

trees.c
Criterion Covered Total %
branch 180 224 80.3


line true false branch
413 19448 68 for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
414 2040 68 for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
415 1292 68 for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
458 15254 3337 while (j <= s->heap_len) {
460 14686 568 if (j < s->heap_len &&
10874 3812 if (j < s->heap_len &&
461 3840 7034 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
3419 421 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
465 14582 672 if (smaller(tree, v, s->heap[j], s->depth)) break;
633 13949 if (smaller(tree, v, s->heap[j], s->depth)) break;
240 393 if (smaller(tree, v, s->heap[j], s->depth)) break;
503 1680 105 for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
510 3496 105 for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
513 0 3496 if (bits > max_length) bits = max_length, overflow++;
517 1643 1853 if (n > max_code) continue; /* not a leaf node */
521 364 1489 if (n >= base) xbits = extra[n - base];
524 1587 266 if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
526 105 0 if (overflow == 0) return;
534 0 0 while (s->bl_count[bits] == 0) bits--;
542 0 0 } while (overflow > 0);
549 0 0 for (bits = max_length; bits != 0; bits--) {
551 0 0 while (n != 0) {
553 0 0 if (m > max_code) continue;
554 0 0 if ((unsigned) tree[m].Len != (unsigned) bits) {
585 1575 105 for (bits = 1; bits <= MAX_BITS; bits++) {
596 10064 105 for (n = 0; n <= max_code; n++) {
598 8211 1853 if (len == 0) continue;
632 11725 105 for (n = 0; n < elems; n++) {
633 1802 9923 if (tree[n].Freq != 0) {
646 51 105 while (s->heap_len < 2) {
647 41 10 node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
650 51 0 s->opt_len--; if (stree) s->static_len -= stree[node].Len;
658 906 105 for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
673 1521 227 s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
686 1643 105 } while (s->heap_len >= 2);
716 35 35 if (nextlen == 0) max_count = 138, min_count = 3;
719 9401 70 for (n = 0; n <= max_code; n++) {
721 9250 151 if (++count < max_count && curlen == nextlen) {
8276 974 if (++count < max_count && curlen == nextlen) {
723 729 396 } else if (count < min_count) {
725 155 241 } else if (curlen != 0) {
726 48 107 if (curlen != prevlen) s->bl_tree[curlen].Freq++;
728 112 129 } else if (count <= 10) {
734 373 752 if (nextlen == 0) {
736 115 637 } else if (curlen == nextlen) {
762 7 7 if (nextlen == 0) max_count = 138, min_count = 3;
764 2056 14 for (n = 0; n <= max_code; n++) {
766 2049 7 if (++count < max_count && curlen == nextlen) {
1853 196 if (++count < max_count && curlen == nextlen) {
768 134 69 } else if (count < min_count) {
769 26 129 do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
21 134 do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
771 1 68 } else if (curlen != 0) {
772 1 0 if (curlen != prevlen) {
773 0 1 send_code(s, curlen, s->bl_tree); count--;
776 0 1 send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
1 0 send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
778 35 33 } else if (count <= 10) {
779 1 34 send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
10 25 send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
782 5 28 send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
13 20 send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
785 86 117 if (nextlen == 0) {
787 0 117 } else if (curlen == nextlen) {
818 70 0 for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
819 35 35 if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
846 0 7 send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
847 0 7 send_bits(s, dcodes - 1, 5);
848 7 0 send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
849 126 7 for (rank = 0; rank < blcodes; rank++) {
851 21 105 send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
871 0 10 send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */
875 6 4 if (stored_len)
902 0 0 send_bits(s, STATIC_TREES<<1, 3);
903 0 0 send_code(s, END_BLOCK, static_ltree);
924 35 0 if (s->level > 0) {
927 32 3 if (s->strm->data_type == Z_UNKNOWN)
956 11 24 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
0 11 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
968 4 31 if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
4 0 if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
979 24 7 } else if (static_lenb == opt_lenb) {
980 0 24 send_bits(s, (STATIC_TREES<<1) + last, 3);
987 0 7 send_bits(s, (DYN_TREES<<1) + last, 3);
1002 29 6 if (last) {
1024 0 0 if (dist == 0) {
1036 0 0 s->dyn_dtree[d_code(dist)].Freq++;
1055 31 0 if (s->sym_next != 0) do {
1059 657 1225 if (dist == 0) {
1060 297 360 send_code(s, lc, ltree); /* send a literal byte */
1065 119 1106 send_code(s, code + LITERALS + 1, ltree); /* send length code */
1067 8 1217 if (extra != 0) {
1069 0 8 send_bits(s, lc, extra); /* send the extra length bits */
1072 1225 0 code = d_code(dist);
1075 43 1182 send_code(s, code, dtree); /* send the distance code */
1077 833 392 if (extra != 0) {
1079 144 689 send_bits(s, dist, extra); /* send the extra distance bits */
1086 1851 31 } while (sx < s->sym_next);
1088 8 23 send_code(s, END_BLOCK, ltree);
1115 931 29 for (n = 0; n <= 31; n++, block_mask >>= 1)
1116 670 261 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
3 667 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
1120 29 0 if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
24 5 if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
1121 0 24 || s->dyn_ltree[13].Freq != 0)
1123 117 0 for (n = 32; n < LITERALS; n++)
1124 24 93 if (s->dyn_ltree[n].Freq != 0)
1146 9531 1853 } while (--len > 0);
1156 1 170 if (s->bi_valid == 16) {
1160 1 169 } else if (s->bi_valid >= 8) {
1173 19 20 if (s->bi_valid > 8) {
1175 17 3 } else if (s->bi_valid > 0) {