Branch Coverage

deps/libgit2/src/xdiff/xemit.c
Criterion Covered Total %
branch 38 122 31.1


line true false branch
38 0 57 if (xdl_emit_diffrec(rec, size, pre, psize, ecb) < 0) {
60 40 0 for (xchp = *xscr; xchp && xchp->ignore; xchp = xchp->next) {
0 40 for (xchp = *xscr; xchp && xchp->ignore; xchp = xchp->next) {
63 0 0 if (xch == NULL ||
0 0 if (xch == NULL ||
68 0 40 if (*xscr == NULL)
73 2 40 for (xchp = *xscr, xch = xchp->next; xch; xchp = xch, xch = xch->next) {
75 0 2 if (distance > max_common)
78 2 0 if (distance < max_ignorable && (!xch->ignore || lxch == xchp)) {
0 2 if (distance < max_ignorable && (!xch->ignore || lxch == xchp)) {
0 0 if (distance < max_ignorable && (!xch->ignore || lxch == xchp)) {
81 0 0 } else if (distance < max_ignorable && xch->ignore) {
0 0 } else if (distance < max_ignorable && xch->ignore) {
83 0 0 } else if (lxch != xchp &&
0 0 } else if (lxch != xchp &&
86 0 0 } else if (!xch->ignore) {
103 0 0 (isalpha((unsigned char)*rec) || /* identifier? */
104 0 0 *rec == '_' || /* also identifier? */
106 0 0 if (len > sz)
108 0 0 while (0 < len && isspace((unsigned char)rec[len - 1]))
0 0 while (0 < len && isspace((unsigned char)rec[len - 1]))
121 0 0 if (!xecfg->find_func)
140 0 38 long l, size, step = (start > limit) ? -1 : 1;
143 38 0 buf = func_line ? func_line->buf : dummy;
144 38 0 size = func_line ? sizeof(func_line->buf) : sizeof(dummy);
146 0 38 for (l = start; l != limit && 0 <= l && l < xe->xdf1.nrec; l += step) {
0 0 for (l = start; l != limit && 0 <= l && l < xe->xdf1.nrec; l += step) {
0 0 for (l = start; l != limit && 0 <= l && l < xe->xdf1.nrec; l += step) {
148 0 0 if (len >= 0) {
149 0 0 if (func_line)
162 0 0 while (len > 0 && XDL_ISSPACE(*rec)) {
0 0 while (len > 0 && XDL_ISSPACE(*rec)) {
176 38 38 for (xch = xscr; xch; xch = xche->next) {
178 0 38 if (!xch)
184 0 38 if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
188 0 0 if (i1 >= xe->xdf1.nrec) {
195 0 0 while (i2 < xe->xdf2.nrec) {
196 0 0 if (is_func_rec(&xe->xdf2, xecfg, i2))
209 0 0 while (fs1 > 0 && !is_empty_rec(&xe->xdf1, fs1 - 1) &&
212 0 0 if (fs1 < 0)
214 0 0 if (fs1 < s1) {
228 0 38 if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
232 0 0 while (fe1 > 0 && is_empty_rec(&xe->xdf1, fe1 - 1))
0 0 while (fe1 > 0 && is_empty_rec(&xe->xdf1, fe1 - 1))
234 0 0 if (fe1 < 0)
236 0 0 if (fe1 > e1) {
246 0 0 if (xche->next) {
261 38 0 if (xecfg->flags & XDL_EMIT_FUNCNAMES) {
266 0 38 if (xdl_emit_hunk_hdr(s1 + 1, e1 - s1, s2 + 1, e2 - s2,
273 2 38 for (; s2 < xch->i2; s2++)
274 0 2 if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0)
281 2 40 for (; s1 < xch->i1 && s2 < xch->i2; s1++, s2++)
2 0 for (; s1 < xch->i1 && s2 < xch->i2; s1++, s2++)
282 0 2 if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0)
288 14 40 for (s1 = xch->i1; s1 < xch->i1 + xch->chg1; s1++)
289 0 14 if (xdl_emit_record(&xe->xdf1, s1, "-", ecb) < 0)
295 37 40 for (s2 = xch->i2; s2 < xch->i2 + xch->chg2; s2++)
296 0 37 if (xdl_emit_record(&xe->xdf2, s2, "+", ecb) < 0)
299 38 2 if (xch == xche)
308 2 38 for (s2 = xche->i2 + xche->chg2; s2 < e2; s2++)
309 0 2 if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0)