Branch Coverage

huffman.c
Criterion Covered Total %
branch 60 66 90.9


line true false branch
79 21008 220 for (i = 0; i < alphaSize; i++)
80 18640 2368 weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
91 21008 220 for (i = 1; i <= alphaSize; i++) {
95 16854 21008 UPHEAP(nHeap);
98 0 220 AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
100 20788 220 while (nHeap > 1) {
101 19606 108660 n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
107274 1386 n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
48497 58777 n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
1182 107478 n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
102 16496 106895 n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
105699 1196 n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
47787 57912 n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
4292 102603 n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
109 1114 20788 UPHEAP(nHeap);
112 0 220 AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 );
115 21008 220 for (i = 1; i <= alphaSize; i++) {
118 162090 21008 while (parent[k] >= 0) { k = parent[k]; j++; }
120 0 21008 if (j > maxLen) tooLong = True;
123 220 0 if (! tooLong) break;
142 0 0 for (i = 1; i <= alphaSize; i++) {
161 180 55 for (n = minLen; n <= maxLen; n++) {
162 22527 180 for (i = 0; i < alphaSize; i++)
163 5252 17275 if (length[i] == n) { code[i] = vec; vec++; };
181 285 81 for (i = minLen; i <= maxLen; i++)
182 32543 285 for (j = 0; j < alphaSize; j++)
183 7154 25389 if (length[j] == i) { perm[pp] = j; pp++; };
185 1863 81 for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0;
186 7154 81 for (i = 0; i < alphaSize; i++) base[length[i]+1]++;
188 1782 81 for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];
190 1863 81 for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0;
193 285 81 for (i = minLen; i <= maxLen; i++) {
198 204 81 for (i = minLen + 1; i <= maxLen; i++)