Branch Coverage

trees.c
Criterion Covered Total %
branch 180 224 80.3


line true false branch
420 19448 68 for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
421 2040 68 for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
422 1292 68 for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
465 15166 3319 while (j <= s->heap_len) {
467 14613 553 if (j < s->heap_len &&
10877 3736 if (j < s->heap_len &&
468 3750 7127 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
3433 317 smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
472 14505 661 if (smaller(tree, v, s->heap[j], s->depth)) break;
634 13871 if (smaller(tree, v, s->heap[j], s->depth)) break;
233 401 if (smaller(tree, v, s->heap[j], s->depth)) break;
510 1680 105 for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
517 3478 105 for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
520 0 3478 if (bits > max_length) bits = max_length, overflow++;
524 1634 1844 if (n > max_code) continue; /* not a leaf node */
528 355 1489 if (n >= base) xbits = extra[n - base];
531 1585 259 if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
533 105 0 if (overflow == 0) return;
541 0 0 while (s->bl_count[bits] == 0) bits--;
549 0 0 } while (overflow > 0);
556 0 0 for (bits = max_length; bits != 0; bits--) {
558 0 0 while (n != 0) {
560 0 0 if (m > max_code) continue;
561 0 0 if ((unsigned) tree[m].Len != (unsigned) bits) {
592 1575 105 for (bits = 1; bits <= MAX_BITS; bits++) {
603 10040 105 for (n = 0; n <= max_code; n++) {
605 8196 1844 if (len == 0) continue;
639 11725 105 for (n = 0; n < elems; n++) {
640 1791 9934 if (tree[n].Freq != 0) {
653 53 105 while (s->heap_len < 2) {
654 43 10 node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
657 53 0 s->opt_len--; if (stree) s->static_len -= stree[node].Len;
665 903 105 for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
680 1519 220 s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
693 1634 105 } while (s->heap_len >= 2);
723 34 36 if (nextlen == 0) max_count = 138, min_count = 3;
726 9379 70 for (n = 0; n <= max_code; n++) {
728 9221 158 if (++count < max_count && curlen == nextlen) {
8261 960 if (++count < max_count && curlen == nextlen) {
730 726 392 } else if (count < min_count) {
732 154 238 } else if (curlen != 0) {
733 41 113 if (curlen != prevlen) s->bl_tree[curlen].Freq++;
735 110 128 } else if (count <= 10) {
741 372 746 if (nextlen == 0) {
743 124 622 } else if (curlen == nextlen) {
769 7 7 if (nextlen == 0) max_count = 138, min_count = 3;
771 2056 14 for (n = 0; n <= max_code; n++) {
773 2049 7 if (++count < max_count && curlen == nextlen) {
1853 196 if (++count < max_count && curlen == nextlen) {
775 134 69 } else if (count < min_count) {
776 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);
778 1 68 } else if (curlen != 0) {
779 1 0 if (curlen != prevlen) {
780 0 1 send_code(s, curlen, s->bl_tree); count--;
783 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);
785 35 33 } else if (count <= 10) {
786 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);
789 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);
792 86 117 if (nextlen == 0) {
794 0 117 } else if (curlen == nextlen) {
825 74 0 for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
826 35 39 if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
853 0 7 send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
854 0 7 send_bits(s, dcodes - 1, 5);
855 7 0 send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
856 126 7 for (rank = 0; rank < blcodes; rank++) {
858 21 105 send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
878 0 10 send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */
882 6 4 if (stored_len)
909 0 0 send_bits(s, STATIC_TREES<<1, 3);
910 0 0 send_code(s, END_BLOCK, static_ltree);
931 35 0 if (s->level > 0) {
934 32 3 if (s->strm->data_type == Z_UNKNOWN)
963 11 24 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
0 11 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
975 4 31 if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
4 0 if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
986 24 7 } else if (static_lenb == opt_lenb) {
987 0 24 send_bits(s, (STATIC_TREES<<1) + last, 3);
994 0 7 send_bits(s, (DYN_TREES<<1) + last, 3);
1009 29 6 if (last) {
1031 0 0 if (dist == 0) {
1043 0 0 s->dyn_dtree[d_code(dist)].Freq++;
1062 31 0 if (s->sym_next != 0) do {
1066 657 1225 if (dist == 0) {
1067 297 360 send_code(s, lc, ltree); /* send a literal byte */
1072 119 1106 send_code(s, code + LITERALS + 1, ltree); /* send length code */
1074 8 1217 if (extra != 0) {
1076 0 8 send_bits(s, lc, extra); /* send the extra length bits */
1079 1225 0 code = d_code(dist);
1082 43 1182 send_code(s, code, dtree); /* send the distance code */
1084 833 392 if (extra != 0) {
1086 144 689 send_bits(s, dist, extra); /* send the extra distance bits */
1093 1851 31 } while (sx < s->sym_next);
1095 8 23 send_code(s, END_BLOCK, ltree);
1122 931 29 for (n = 0; n <= 31; n++, block_mask >>= 1)
1123 670 261 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
3 667 if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
1127 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
1128 0 24 || s->dyn_ltree[13].Freq != 0)
1130 117 0 for (n = 32; n < LITERALS; n++)
1131 24 93 if (s->dyn_ltree[n].Freq != 0)
1153 9481 1844 } while (--len > 0);
1163 1 170 if (s->bi_valid == 16) {
1167 1 169 } else if (s->bi_valid >= 8) {
1180 19 20 if (s->bi_valid > 8) {
1182 17 3 } else if (s->bi_valid > 0) {