Branch Coverage

deps/libgit2/src/libgit2/xdiff/xemit.c
Criterion Covered Total %
branch 37 128 28.9


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) {
101 0 0 (isalpha((unsigned char)*rec) || /* identifier? */
102 0 0 *rec == '_' || /* also identifier? */
104 0 0 if (len > sz)
106 0 0 while (0 < len && isspace((unsigned char)rec[len - 1]))
0 0 while (0 < len && isspace((unsigned char)rec[len - 1]))
119 0 0 if (!xecfg->find_func)
138 0 38 long l, size, step = (start > limit) ? -1 : 1;
141 38 0 buf = func_line ? func_line->buf : dummy;
142 38 0 size = func_line ? sizeof(func_line->buf) : sizeof(dummy);
144 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) {
146 0 0 if (len >= 0) {
147 0 0 if (func_line)
160 0 0 while (len > 0 && XDL_ISSPACE(*rec)) {
0 0 while (len > 0 && XDL_ISSPACE(*rec)) {
174 38 38 for (xch = xscr; xch; xch = xche->next) {
177 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) {
222 0 0 while (xchp != xch &&
0 0 while (xchp != xch &&
223 0 0 xchp->i1 + xchp->chg1 <= s1 &&
228 0 0 if (xchp != xch) {
243 0 38 if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
247 0 0 while (fe1 > 0 && is_empty_rec(&xe->xdf1, fe1 - 1))
0 0 while (fe1 > 0 && is_empty_rec(&xe->xdf1, fe1 - 1))
249 0 0 if (fe1 < 0)
251 0 0 if (fe1 > e1) {
261 0 0 if (xche->next) {
276 38 0 if (xecfg->flags & XDL_EMIT_FUNCNAMES) {
289 2 38 for (; s2 < xch->i2; s2++)
290 0 2 if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0)
297 2 40 for (; s1 < xch->i1 && s2 < xch->i2; s1++, s2++)
2 0 for (; s1 < xch->i1 && s2 < xch->i2; s1++, s2++)
298 0 2 if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0)
304 14 40 for (s1 = xch->i1; s1 < xch->i1 + xch->chg1; s1++)
305 0 14 if (xdl_emit_record(&xe->xdf1, s1, "-", ecb) < 0)
311 37 40 for (s2 = xch->i2; s2 < xch->i2 + xch->chg2; s2++)
312 0 37 if (xdl_emit_record(&xe->xdf2, s2, "+", ecb) < 0)
315 38 2 if (xch == xche)
324 2 38 for (s2 = xche->i2 + xche->chg2; s2 < e2; s2++)
325 0 2 if (xdl_emit_record(&xe->xdf2, s2, " ", ecb) < 0)