Branch Coverage

deps/libgit2/src/util/regexp.c
Criterion Covered Total %
branch 5 26 19.2


line true false branch
17 0 46 if (flags & GIT_REGEXP_ICASE)
20 0 46 if ((*r = pcre_compile(pattern, cflags, &error, &erroffset, NULL)) == NULL) {
37 739 14 if ((error = pcre_exec(*r, NULL, string, (int) strlen(string), 0, 0, NULL, 0)) < 0)
38 739 0 return (error == PCRE_ERROR_NOMATCH) ? GIT_ENOTFOUND : GIT_EINVALIDSPEC;
49 0 0 if (nmatches <= ARRAY_SIZE(static_ovec) / 3)
53 0 0 GIT_ERROR_CHECK_ALLOC(ovec);
55 0 0 if ((error = pcre_exec(*r, NULL, string, (int) strlen(string), 0, 0, ovec, (int) nmatches * 3)) < 0)
58 0 0 if (error == 0)
61 0 0 for (i = 0; i < (unsigned int) error; i++) {
65 0 0 for (i = (unsigned int) error; i < nmatches; i++)
69 0 0 if (nmatches > ARRAY_SIZE(static_ovec) / 3)
71 0 0 if (error < 0)
72 0 0 return (error == PCRE_ERROR_NOMATCH) ? GIT_ENOTFOUND : GIT_EINVALIDSPEC;