Branch Coverage

draw.c
Criterion Covered Total %
branch 483 600 80.5


line true false branch
18 0 53757 if (!col->channel[3])
37 0 0 if (work.channel[1] == 255) {
64 0 0 if (work.channel[3] == 255) {
93 0 87 if (alloc_size / l != sizeof(minmax)) {
98 20500 87 for(i=0;i
107 87 0 if (ar->data != NULL) { myfree(ar->data); ar->data=NULL; }
112 2658029 0 if (y>-1 && ylines)
2658029 0 if (y>-1 && ylines)
114 11428 2646601 if (xdata[y].min) ar->data[y].min=x;
115 13377 2644652 if (x>ar->data[y].max) ar->data[y].max=x;
121 0 0 if (y>-1 && ylines) return ar->data[y].min;
0 0 if (y>-1 && ylines) return ar->data[y].min;
127 0 0 if (y>-1 && ylines)
0 0 if (y>-1 && ylines)
149 172 2 if (fabs(alpha) <= 1)
151 8 164 if (x2
153 4988 172 while(x1<=x2)
163 0 2 if (y2
165 156 2 while(y1<=y2)
177 0 0 for(i=0;ilines;i++)
178 0 0 if (ar->data[i].max!=-1)
200 2652885 87 for(f=d1;f<=d2;f+=0.01)
207 20500 87 for (y = 0; y < dot.lines; y++) {
208 4708 15792 if (dot.data[y].max!=-1) {
222 71 8 if (d1 <= d2) {
302 1 25 if (d1 == 0) {
303 0 1 if (d2 >= 360) { /* default is 361 */
308 0 1 if (d2 < d1)
314 3 22 if (d2 < d1)
331 24 2 if (steps > MAX_CIRCLE_STEPS)
333 0 2 else if (steps < MIN_CIRCLE_STEPS)
351 565 26 while (d1_rad < d2_rad) {
517 1 7 if (first_row < 0)
519 1 7 if (last_row > im->ysize-1)
521 0 8 if (first_col < 0)
523 1 7 if (last_col > im->xsize-1)
526 8 0 if (rad <= 0 || last_row < first_row || last_col < first_col) {
8 0 if (rad <= 0 || last_row < first_row || last_col < first_col) {
1 7 if (rad <= 0 || last_row < first_row || last_col < first_col) {
534 380 7 for(ly = first_row; ly < last_row; ly++) {
545 6080 380 for (sub = 0; sub < 16; ++sub) {
550 6073 7 if (dy_sqr < r_sqr) {
557 2049 4024 if (frac_left_x < min_frac_left_x)
559 2041 4032 if (frac_left_x > max_frac_left_x)
561 0 6073 if (frac_right_x < min_frac_right_x)
563 2049 4024 if (frac_right_x > max_frac_right_x)
575 380 0 if (min_frac_left_x != -1) {
585 21592 380 for (work_x = min_x, frac_work_x = min_x * 16;
588 20479 1113 if (work_x <= left_solid || work_x >= right_solid) {
20479 0 if (work_x <= left_solid || work_x >= right_solid) {
593 345472 21592 for (sub = 0; sub < 16; ++sub) {
596 345359 113 if (pix_left < pix_right
597 342890 2469 && pix_left < frac_work_right
598 334931 7959 && pix_right >= frac_work_x) {
599 328858 6073 if (pix_left < frac_work_x)
601 328275 6656 if (pix_right > frac_work_right)
680 0 13 if (r < 0) {
695 796 13 while (x < y) {
696 332 464 if (error >= 0) {
709 789 7 if (x != y) {
734 0 244 while (seg > 4)
736 30 214 if (seg == 4 && remains > 0)
0 30 if (seg == 4 && remains > 0)
799 0 49 if (r <= 0) {
803 0 49 if (d1 + 360 <= d2)
806 0 49 if (d1 < 0)
808 0 49 if (d2 < 0)
814 23 26 if (seg_d2 < seg_d1) {
828 72 49 for (seg_num = 0; seg_num < seg_count; ++seg_num) {
831 25 47 if (seg_start == 0)
833 37 35 if (seg_start <= seg1 && seg_end >= seg1)
25 12 if (seg_start <= seg1 && seg_end >= seg1)
835 49 23 if (seg_start <= seg2 && seg_end >= seg2)
24 25 if (seg_start <= seg2 && seg_end >= seg2)
837 62 10 if (seg_start <= seg3 && seg_end >= seg3)
25 37 if (seg_start <= seg3 && seg_end >= seg3)
845 4870 72 while (y < x) {
846 2028 2842 if (error >= 0) {
856 1799 3071 if (seg_start <= sin_th && seg_end >= sin_th)
1602 197 if (seg_start <= sin_th && seg_end >= sin_th)
858 1972 2898 if (seg_start <= seg1 - sin_th && seg_end >= seg1 - sin_th)
1495 477 if (seg_start <= seg1 - sin_th && seg_end >= seg1 - sin_th)
861 2206 2664 if (seg_start <= seg1 + sin_th && seg_end >= seg1 + sin_th)
1414 792 if (seg_start <= seg1 + sin_th && seg_end >= seg1 + sin_th)
863 2543 2327 if (seg_start <= seg2 - sin_th && seg_end >= seg2 - sin_th)
1398 1145 if (seg_start <= seg2 - sin_th && seg_end >= seg2 - sin_th)
866 2924 1946 if (seg_start <= seg2 + sin_th && seg_end >= seg2 + sin_th)
1382 1542 if (seg_start <= seg2 + sin_th && seg_end >= seg2 + sin_th)
868 3419 1451 if (seg_start <= seg3 - sin_th && seg_end >= seg3 - sin_th)
1363 2056 if (seg_start <= seg3 - sin_th && seg_end >= seg3 - sin_th)
871 4010 860 if (seg_start <= seg3 + sin_th && seg_end >= seg3 + sin_th)
1443 2567 if (seg_start <= seg3 + sin_th && seg_end >= seg3 + sin_th)
873 4665 205 if (seg_start <= seg4 - sin_th && seg_end >= seg4 - sin_th)
1704 2961 if (seg_start <= seg4 - sin_th && seg_end >= seg4 - sin_th)
938 0 25 if (r <= 0) {
950 1798 25 while (i > j+1) {
957 732 1066 if (d < t) {
960 1798 0 if (inv_cv) {
967 1787 11 if (i != j) {
974 1779 19 if (cv && i > j) {
1768 11 if (cv && i > j) {
981 1754 14 if (j != i-1) {
1052 0 73 if (r <= 0) {
1056 0 73 if (d1 + 360 <= d2)
1059 0 73 if (d1 < 0)
1061 0 73 if (d2 < 0)
1067 24 49 if (seg_d2 < seg_d1) {
1081 97 73 for (seg_num = 0; seg_num < seg_count; ++seg_num) {
1089 27 70 if (seg_start == 0)
1091 45 52 if (seg_start <= seg1 && seg_end >= seg1)
27 18 if (seg_start <= seg1 && seg_end >= seg1)
1093 63 34 if (seg_start <= seg2 && seg_end >= seg2)
26 37 if (seg_start <= seg2 && seg_end >= seg2)
1095 82 15 if (seg_start <= seg3 && seg_end >= seg3)
27 55 if (seg_start <= seg3 && seg_end >= seg3)
1098 7838 97 while (i > j+1) {
1105 3193 4645 if (d < t) {
1109 7838 0 if (inv_cv) {
1112 2137 5701 if (seg_start <= sin_th && seg_end >= sin_th)
1711 426 if (seg_start <= sin_th && seg_end >= sin_th)
1114 3975 3863 if (seg_start <= seg2 - sin_th && seg_end >= seg2 - sin_th)
1514 2461 if (seg_start <= seg2 - sin_th && seg_end >= seg2 - sin_th)
1116 7525 313 if (seg_start <= seg4 - sin_th && seg_end >= seg4 - sin_th)
1814 5711 if (seg_start <= seg4 - sin_th && seg_end >= seg4 - sin_th)
1118 4696 3142 if (seg_start <= seg2 + sin_th && seg_end >= seg2 + sin_th)
1498 3198 if (seg_start <= seg2 + sin_th && seg_end >= seg2 + sin_th)
1121 7800 38 if (i != j) {
1122 2671 5129 if (seg_start <= seg1 - sin_th && seg_end >= seg1 - sin_th)
1591 1080 if (seg_start <= seg1 - sin_th && seg_end >= seg1 - sin_th)
1124 3241 4559 if (seg_start <= seg1 + sin_th && seg_end >= seg1 + sin_th)
1520 1721 if (seg_start <= seg1 + sin_th && seg_end >= seg1 + sin_th)
1126 6458 1342 if (seg_start <= seg3 + sin_th && seg_end >= seg3 + sin_th)
1540 4918 if (seg_start <= seg3 + sin_th && seg_end >= seg3 + sin_th)
1128 5540 2260 if (seg_start <= seg3 - sin_th && seg_end >= seg3 - sin_th)
1467 4073 if (seg_start <= seg3 - sin_th && seg_end >= seg3 - sin_th)
1132 7691 147 if (cv && i > j) {
7653 38 if (cv && i > j) {
1134 2093 5560 if (seg_start <= sin_th && seg_end >= sin_th)
1681 412 if (seg_start <= sin_th && seg_end >= sin_th)
1136 3879 3774 if (seg_start <= seg2 - sin_th && seg_end >= seg2 - sin_th)
1487 2392 if (seg_start <= seg2 - sin_th && seg_end >= seg2 - sin_th)
1138 7348 305 if (seg_start <= seg4 - sin_th && seg_end >= seg4 - sin_th)
1782 5566 if (seg_start <= seg4 - sin_th && seg_end >= seg4 - sin_th)
1140 4579 3074 if (seg_start <= seg2 + sin_th && seg_end >= seg2 + sin_th)
1472 3107 if (seg_start <= seg2 + sin_th && seg_end >= seg2 + sin_th)
1143 2628 5025 if (seg_start <= seg1 - sin_th && seg_end >= seg1 - sin_th)
1572 1056 if (seg_start <= seg1 - sin_th && seg_end >= seg1 - sin_th)
1145 3181 4472 if (seg_start <= seg1 + sin_th && seg_end >= seg1 + sin_th)
1503 1678 if (seg_start <= seg1 + sin_th && seg_end >= seg1 + sin_th)
1147 6331 1322 if (seg_start <= seg3 + sin_th && seg_end >= seg3 + sin_th)
1521 4810 if (seg_start <= seg3 + sin_th && seg_end >= seg3 + sin_th)
1149 5432 2221 if (seg_start <= seg3 - sin_th && seg_end >= seg3 - sin_th)
1449 3983 if (seg_start <= seg3 - sin_th && seg_end >= seg3 - sin_th)
1177 238 4 for(x=x1;x
1181 178 4 for(y=y1;y
1207 903 0 if (x1 > x2 || y1 > y2
903 0 if (x1 > x2 || y1 > y2
1208 903 0 || x2 < 0 || y2 < 0
903 0 || x2 < 0 || y2 < 0
1209 903 0 || x1 >= im->xsize || y1 > im->ysize)
0 903 || x1 >= im->xsize || y1 > im->ysize)
1212 0 903 if (x1 < 0)
1214 2 901 if (x2 >= im->xsize)
1216 0 903 if (y1 < 0)
1218 2 901 if (y2 >= im->ysize)
1223 25 878 if (im->type == i_palette_type
1224 25 0 && i_findcolor(im, val, &index)) {
24 1 && i_findcolor(im, val, &index)) {
1227 741 24 for (x = 0; x < width; ++x)
1230 893 24 for (y = y1; y <= y2; ++y)
1231 893 0 i_ppal(im, x1, x2+1, y, line);
1238 21808 879 for (x = 0; x < width; ++x)
1241 28386 879 for (y = y1; y <= y2; ++y)
1268 37 0 if (x1 > x2 || y1 > y2
37 0 if (x1 > x2 || y1 > y2
1269 37 0 || x2 < 0 || y2 < 0
37 0 || x2 < 0 || y2 < 0
1270 37 0 || x1 >= im->xsize || y1 > im->ysize)
0 37 || x1 >= im->xsize || y1 > im->ysize)
1273 0 37 if (x1 < 0)
1275 0 37 if (x2 >= im->xsize)
1277 0 37 if (y1 < 0)
1279 0 37 if (y2 >= im->ysize)
1284 0 37 if (im->bits <= 8) {
1296 715 37 for (x = 0; x < width; ++x)
1299 1001 37 for (y = y1; y <= y2; ++y)
1328 0 125 if (x1 < 0)
1330 0 125 if (y1 < 0)
1332 0 125 if (x2 > im->xsize)
1334 0 125 if (y2 >= im->ysize)
1336 125 0 if (x1 >= x2 || y1 > y2)
0 125 if (x1 >= x2 || y1 > y2)
1340 134031 125 while (y1 <= y2) {
1378 149 256 if (i_abs(dx) > i_abs(dy)) {
1382 64 85 if (x1 > x2) {
1392 65 84 if (dy<0) {
1403 16248 149 for(x=x1; x
1404 11755 4493 if (p<0) {
1416 70 186 if (y1 > y2) {
1426 70 186 if (dx<0) {
1437 39117 256 for(y=y1; y
1438 33873 5244 if (p<0) {
1447 405 0 if (endp) {
1451 0 0 if (x1 != x2 || y1 != y2)
0 0 if (x1 != x2 || y1 != y2)
1463 0 0 for(x=x1; x<=x2; x++) {
1491 70 80 if (i_abs(dx) > i_abs(dy)) {
1495 34 36 if (x1 > x2) {
1505 32 38 if (dy<0) {
1516 11461 70 for(x=x1; x
1519 10725 736 double t = (dy) ? -(float)(p)/(float)(dx2) : 1;
1522 4304 7157 if (t<0) t = 0;
1527 34383 11461 for(ch=0;chchannels;ch++)
1532 34383 11461 for(ch=0;chchannels;ch++)
1536 7081 4380 if (p<0) {
1547 38 42 if (y1 > y2) {
1557 36 44 if (dx<0) {
1568 12579 80 for(y=y1; y
1571 11843 736 double t = (dx) ? -(double)(p)/(double)(dy2) : 1;
1574 4344 8235 if (t<0) t = 0;
1579 37737 12579 for(ch=0;chchannels;ch++)
1584 37737 12579 for(ch=0;chchannels;ch++)
1588 7101 5478 if (p<0) {
1598 150 0 if (endp) {
1602 0 0 if (x1 != x2 || y1 != y2)
0 0 if (x1 != x2 || y1 != y2)
1614 0 0 for(i=k+1;i<=n;i++) r*=i;
1615 0 0 for(i=1;i<=(n-k);i++) r/=i;
1636 0 0 for(k=0;k
1642 0 0 for(t=0;t<=1;t+=0.005) {
1646 0 0 for(k=0;k
1655 0 0 if (i++) {
1730 53413 15341 for(i = 0; i < ch; i++)
1731 5550 47863 if (val1->channel[i] !=val2->channel[i])
1739 10050 920 for(i = 0; i < ch; i++)
1740 4860 5190 if (val1->channel[i] !=val2->channel[i])
1749 55 662 if (seedx-1 < 0) break;
1751 35 627 if (!cmpfunc(val,&cval,im->channels))
1762 56 654 if (seedx+1 > im->xsize-1) break;
1764 34 620 if (!cmpfunc(val,&cval,im->channels)) break;
1869 1337 90 for(tx=ltx; tx<=rtx; tx++) SET(tx, seedy);
1876 3020 90 while(st->count) {
1889 2960 60 if (y<0 || y>ysize-1) continue;
61 2899 if (y<0 || y>ysize-1) continue;
1890 844 2055 if (bymin > y) bymin=y; /* in the worst case an extra line */
1891 909 1990 if (bymax < y) bymax=y;
1895 2899 0 if ( lx >= 0 && (wasIn = INSIDE(lx, y, seed)) ) {
2835 64 if ( lx >= 0 && (wasIn = INSIDE(lx, y, seed)) ) {
2696 139 if ( lx >= 0 && (wasIn = INSIDE(lx, y, seed)) ) {
2696 203 if ( lx >= 0 && (wasIn = INSIDE(lx, y, seed)) ) {
1898 2460 1010 while(lx >= 0 && INSIDE(lx, y, seed)) {
2460 0 while(lx >= 0 && INSIDE(lx, y, seed)) {
774 1686 while(lx >= 0 && INSIDE(lx, y, seed)) {
774 1686 while(lx >= 0 && INSIDE(lx, y, seed)) {
1906 17 2882 if (bxmin > lx) bxmin = lx;
1907 21896 1063 while(x <= xsize-1) {
1909 17169 4727 if (wasIn) {
1911 17169 0 if (INSIDE(x, y, seed)) {
15412 1757 if (INSIDE(x, y, seed)) {
15412 1757 if (INSIDE(x, y, seed)) {
1917 7 1750 ST_STACK(direction, dadLx, dadRx, lx, (x-1), y);
7 1750 ST_STACK(direction, dadLx, dadRx, lx, (x-1), y);
1919 35 1722 if (bxmax < x) bxmax = x;
1923 1836 2891 if (x > rx) goto EXT;
1924 2891 0 if (INSIDE(x, y, seed)) {
72 2819 if (INSIDE(x, y, seed)) {
72 2819 if (INSIDE(x, y, seed)) {
1936 1011 1888 if (wasIn) {
1938 18 993 ST_STACK(direction, dadLx, dadRx, lx, (x-1), y);
40 971 ST_STACK(direction, dadLx, dadRx, lx, (x-1), y);
1939 69 942 if (bxmax < x) bxmax = x;
1979 87 0 if (seedx < 0 || seedx >= im->xsize ||
87 0 if (seedx < 0 || seedx >= im->xsize ||
87 0 if (seedx < 0 || seedx >= im->xsize ||
1980 0 87 seedy < 0 || seedy >= im->ysize) {
1991 1594 87 for(y=bymin;y<=bymax;y++)
1992 40418 1594 for(x=bxmin;x<=bxmax;x++)
1993 12998 27420 if (btm_test(btm,x,y))
2025 1 0 if (seedx < 0 || seedx >= im->xsize ||
1 0 if (seedx < 0 || seedx >= im->xsize ||
1 0 if (seedx < 0 || seedx >= im->xsize ||
2026 0 1 seedy < 0 || seedy >= im->ysize) {
2070 1 0 if (seedx < 0 || seedx >= im->xsize ||
1 0 if (seedx < 0 || seedx >= im->xsize ||
1 0 if (seedx < 0 || seedx >= im->xsize ||
2071 0 1 seedy < 0 || seedy >= im->ysize) {
2079 83 1 for(y=bymin;y<=bymax;y++)
2080 6806 83 for(x=bxmin;x<=bxmax;x++)
2081 2431 4375 if (btm_test(btm,x,y))
2114 1 0 if (seedx < 0 || seedx >= im->xsize ||
1 0 if (seedx < 0 || seedx >= im->xsize ||
1 0 if (seedx < 0 || seedx >= im->xsize ||
2115 0 1 seedy < 0 || seedy >= im->ysize) {
2140 166 2 for(y=bymin; y<=bymax; y++) {
2142 468 166 while (x <= bxmax) {
2143 9052 166 while (x <= bxmax && !btm_test(btm, x, y)) {
8750 302 while (x <= bxmax && !btm_test(btm, x, y)) {
2146 302 166 if (btm_test(btm, x, y)) {
2148 5164 0 while (x <= bxmax && btm_test(btm, x, y)) {
4862 302 while (x <= bxmax && btm_test(btm, x, y)) {