Branch Coverage

trees.c
Criterion Covered Total %
branch 180 224 80.3


line true false branch
159 9506 1847 } while (--len > 0);
167 1 167 if (s->bi_valid == 16) {
171 1 166 } else if (s->bi_valid >= 8) {
182 19 20 if (s->bi_valid > 8) {
184 17 3 } else if (s->bi_valid > 0) {
212 1575 105 for (bits = 1; bits <= MAX_BITS; bits++) {
223 10060 105 for (n = 0; n <= max_code; n++) {
225 8213 1847 if (len == 0) continue;
444 19448 68 for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
445 2040 68 for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
446 1292 68 for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
512 15190 3318 while (j <= s->heap_len) {
514 14643 547 if (j < s->heap_len &&
515 10976 3667 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
3771 7205 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
3458 313 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
519 14502 688 if (smaller(tree, v, s->heap[j], s->depth)) break;
611 13891 if (smaller(tree, v, s->heap[j], s->depth)) break;
230 381 if (smaller(tree, v, s->heap[j], s->depth)) break;
554 1680 105 for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
561 3484 105 for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
564 0 3484 if (bits > max_length) bits = max_length, overflow++;
568 1637 1847 if (n > max_code) continue; /* not a leaf node */
572 358 1489 if (n >= base) xbits = extra[n - base];
575 1585 262 if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
577 105 0 if (overflow == 0) return;
585 0 0 while (s->bl_count[bits] == 0) bits--;
593 0 0 } while (overflow > 0);
600 0 0 for (bits = max_length; bits != 0; bits--) {
602 0 0 while (n != 0) {
604 0 0 if (m > max_code) continue;
605 0 0 if ((unsigned) tree[m].Len != (unsigned) bits) {
641 11725 105 for (n = 0; n < elems; n++) {
642 1794 9931 if (tree[n].Freq != 0) {
655 53 105 while (s->heap_len < 2) {
656 41 12 node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
659 53 0 s->opt_len--; if (stree) s->static_len -= stree[node].Len;
667 903 105 for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
682 1520 222 s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
695 1637 105 } while (s->heap_len >= 2);
721 33 37 if (nextlen == 0) max_count = 138, min_count = 3;
724 9397 70 for (n = 0; n <= max_code; n++) {
726 9246 151 if (++count < max_count && curlen == nextlen) {
8277 969 if (++count < max_count && curlen == nextlen) {
728 726 394 } else if (count < min_count) {
730 155 239 } else if (curlen != 0) {
731 45 110 if (curlen != prevlen) s->bl_tree[curlen].Freq++;
733 110 129 } else if (count <= 10) {
739 372 748 if (nextlen == 0) {
741 118 630 } else if (curlen == nextlen) {
763 7 7 if (nextlen == 0) max_count = 138, min_count = 3;
765 2056 14 for (n = 0; n <= max_code; n++) {
767 2049 7 if (++count < max_count && curlen == nextlen) {
1853 196 if (++count < max_count && curlen == nextlen) {
769 134 69 } else if (count < min_count) {
770 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);
772 1 68 } else if (curlen != 0) {
773 1 0 if (curlen != prevlen) {
774 0 1 send_code(s, curlen, s->bl_tree); count--;
777 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);
779 35 33 } else if (count <= 10) {
780 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);
783 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);
786 86 117 if (nextlen == 0) {
788 0 117 } else if (curlen == nextlen) {
817 72 0 for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
818 35 37 if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
841 0 7 send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
842 0 7 send_bits(s, dcodes - 1, 5);
843 7 0 send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
844 126 7 for (rank = 0; rank < blcodes; rank++) {
846 21 105 send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
862 0 10 send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */
866 6 4 if (stored_len)
889 0 0 send_bits(s, STATIC_TREES<<1, 3);
890 0 0 send_code(s, END_BLOCK, static_ltree);
908 31 0 if (s->sym_next != 0) do {
917 657 1225 if (dist == 0) {
918 297 360 send_code(s, lc, ltree); /* send a literal byte */
923 119 1106 send_code(s, code + LITERALS + 1, ltree); /* send length code */
925 8 1217 if (extra != 0) {
927 0 8 send_bits(s, lc, extra); /* send the extra length bits */
930 1225 0 code = d_code(dist);
933 43 1182 send_code(s, code, dtree); /* send the distance code */
935 833 392 if (extra != 0) {
937 144 689 send_bits(s, (int)dist, extra); /* send the extra bits */
948 1851 31 } while (sx < s->sym_next);
950 8 23 send_code(s, END_BLOCK, ltree);
975 931 29 for (n = 0; n <= 31; n++, block_mask >>= 1)
976 670 261 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
3 667 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
980 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
981 0 24 || s->dyn_ltree[13].Freq != 0)
983 117 0 for (n = 32; n < LITERALS; n++)
984 24 93 if (s->dyn_ltree[n].Freq != 0)
1003 35 0 if (s->level > 0) {
1006 32 3 if (s->strm->data_type == Z_UNKNOWN)
1035 11 24 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
0 11 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
1047 4 31 if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
4 0 if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
1058 24 7 } else if (static_lenb == opt_lenb) {
1059 0 24 send_bits(s, (STATIC_TREES<<1) + last, 3);
1066 0 7 send_bits(s, (DYN_TREES<<1) + last, 3);
1081 29 6 if (last) {
1104 0 0 if (dist == 0) {
1116 0 0 s->dyn_dtree[d_code(dist)].Freq++;