Branch Coverage

deps/libgit2/src/hashsig.c
Criterion Covered Total %
branch 68 114 59.6


line true false branch
59 48 6 return (av < bv) ? -1 : (av > bv) ? 1 : 0;
66 68 0 return (av > bv) ? -1 : (av < bv) ? 1 : 0;
73 50 24 while (el > 0 && h->cmp(&h->values[parent_el], &h->values[el], NULL) > 0) {
2 48 while (el > 0 && h->cmp(&h->values[parent_el], &h->values[el], NULL) > 0) {
89 0 0 while (el < h->size / 2) {
96 0 0 if (h->cmp(&v, &lv, NULL) < 0 && h->cmp(&v, &rv, NULL) < 0)
0 0 if (h->cmp(&v, &lv, NULL) < 0 && h->cmp(&v, &rv, NULL) < 0)
99 0 0 swapel = (h->cmp(&lv, &rv, NULL) < 0) ? lel : rel;
117 72 0 if (h->size < h->asize) {
123 0 0 else if (h->cmp(&val, &h->values[0], NULL) > 0) {
142 2 9 assert(!(sig->opt & GIT_HASHSIG_IGNORE_WHITESPACE) ||
0 2 assert(!(sig->opt & GIT_HASHSIG_IGNORE_WHITESPACE) ||
145 2 9 if (sig->opt & GIT_HASHSIG_IGNORE_WHITESPACE) {
146 512 2 for (i = 0; i < 256; ++i)
149 9 0 } else if (sig->opt & GIT_HASHSIG_SMART_WHITESPACE) {
150 2304 9 for (i = 0; i < 256; ++i)
169 39 11 while (scan < end) {
172 575 4 for (len = 0; scan < end && len < HASHSIG_MAX_RUN; ) {
575 0 for (len = 0; scan < end && len < HASHSIG_MAX_RUN; ) {
175 139 436 if (use_ignores)
176 141 0 for (; scan < end && git__isspace_nonlf(ch); ch = *scan)
2 139 for (; scan < end && git__isspace_nonlf(ch); ch = *scan)
178 436 0 else if (sig->opt &
180 436 0 for (; scan < end && ch == '\r'; ch = *scan)
0 436 for (; scan < end && ch == '\r'; ch = *scan)
184 465 110 if (sig->opt & GIT_HASHSIG_SMART_WHITESPACE)
187 0 575 if (scan >= end)
192 540 35 if (ch == '\n' || ch == '\0') {
0 540 if (ch == '\n' || ch == '\0') {
201 36 3 if (len > 0) {
205 25 11 while (scan < end && (*scan == '\n' || !*scan))
0 25 while (scan < end && (*scan == '\n' || !*scan))
0 25 while (scan < end && (*scan == '\n' || !*scan))
217 4 7 if (sig->mins.size < HASHSIG_HEAP_MIN_SIZE &&
0 4 if (sig->mins.size < HASHSIG_HEAP_MIN_SIZE &&
233 0 11 if (!sig)
252 0 6 GIT_ERROR_CHECK_ALLOC(sig);
258 6 0 if (!error)
261 6 0 if (!error)
279 0 5 GIT_ERROR_CHECK_ALLOC(sig);
281 0 5 if ((fd = git_futils_open_ro(path)) < 0) {
288 10 0 while (!error) {
289 5 5 if ((buflen = p_read(fd, buf, sizeof(buf))) <= 0) {
290 0 5 if ((error = (int)buflen) < 0)
301 5 0 if (!error)
304 5 0 if (!error)
321 0 7 assert(a->cmp == b->cmp);
325 24 1 for (i = 0, j = 0; i < a->size && j < b->size; ) {
18 6 for (i = 0, j = 0; i < a->size && j < b->size; ) {
328 0 18 if (cmp < 0)
330 6 12 else if (cmp > 0)
346 0 7 if (a->mins.size == 0 && b->mins.size == 0) {
0 0 if (a->mins.size == 0 && b->mins.size == 0) {
347 0 0 if ((!a->lines && !b->lines) ||
0 0 if ((!a->lines && !b->lines) ||
0 0 if ((!a->lines && !b->lines) ||
357 7 0 if (a->mins.size < HASHSIG_HEAP_SIZE)