Branch Coverage

deps/libgit2/src/util/wildmatch.c
Criterion Covered Total %
branch 41 280 14.6


line true false branch
102 2595 14 for ( ; (p_ch = *p) != '\0'; text++, p++) {
105 553 2042 if ((t_ch = *text) == '\0' && p_ch != '*')
552 1 if ((t_ch = *text) == '\0' && p_ch != '*')
107 17 2026 if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
17 0 if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
0 17 if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
109 17 2026 if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
17 0 if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
8 9 if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
118 1789 227 if (t_ch != p_ch)
123 0 0 if ((flags & WM_PATHNAME) && t_ch == '/')
0 0 if ((flags & WM_PATHNAME) && t_ch == '/')
127 3 24 if (*++p == '*') {
129 0 3 while (*++p == '*') {}
130 3 0 if (!(flags & WM_PATHNAME))
133 0 0 else if ((prev_p < pattern || *prev_p == '/') &&
0 0 else if ((prev_p < pattern || *prev_p == '/') &&
0 0 else if ((prev_p < pattern || *prev_p == '/') &&
134 0 0 (*p == '\0' || *p == '/' ||
0 0 (*p == '\0' || *p == '/' ||
135 0 0 (p[0] == '\\' && p[1] == '/'))) {
154 24 3 if (*p == '\0') {
157 0 24 if (!match_slash) {
158 0 0 if (strchr((char*)text, '/') != NULL)
162 0 3 } else if (!match_slash && *p == '/') {
0 0 } else if (!match_slash && *p == '/') {
169 0 0 if (!slash)
176 0 6 if (t_ch == '\0')
186 6 0 if (!is_glob_special(*p)) {
188 0 6 if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
0 0 if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
0 0 if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
190 30 2 while ((t_ch = *text) != '\0' &&
30 0 while ((t_ch = *text) != '\0' &&
191 0 0 (match_slash || t_ch != '/')) {
192 0 30 if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
0 0 if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
0 0 if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
194 4 26 if (t_ch == p_ch)
198 2 4 if (t_ch != p_ch)
201 1 3 if ((matched = dowild(p, text, flags)) != WM_NOMATCH) {
202 1 0 if (!match_slash || matched != WM_ABORT_TO_STARSTAR)
1 0 if (!match_slash || matched != WM_ABORT_TO_STARSTAR)
204 0 3 } else if (!match_slash && t_ch == '/')
0 0 } else if (!match_slash && t_ch == '/')
212 0 0 if (p_ch == NEGATE_CLASS2)
217 0 0 if (negated) {
224 0 0 if (!p_ch)
226 0 0 if (p_ch == '\\') {
228 0 0 if (!p_ch)
230 0 0 if (t_ch == p_ch)
232 0 0 } else if (p_ch == '-' && prev_ch && p[1] && p[1] != ']') {
0 0 } else if (p_ch == '-' && prev_ch && p[1] && p[1] != ']') {
0 0 } else if (p_ch == '-' && prev_ch && p[1] && p[1] != ']') {
0 0 } else if (p_ch == '-' && prev_ch && p[1] && p[1] != ']') {
234 0 0 if (p_ch == '\\') {
236 0 0 if (!p_ch)
239 0 0 if (t_ch <= p_ch && t_ch >= prev_ch)
0 0 if (t_ch <= p_ch && t_ch >= prev_ch)
241 0 0 else if ((flags & WM_CASEFOLD) && ISLOWER(t_ch)) {
0 0 else if ((flags & WM_CASEFOLD) && ISLOWER(t_ch)) {
0 0 else if ((flags & WM_CASEFOLD) && ISLOWER(t_ch)) {
243 0 0 if (t_ch_upper <= p_ch && t_ch_upper >= prev_ch)
0 0 if (t_ch_upper <= p_ch && t_ch_upper >= prev_ch)
247 0 0 } else if (p_ch == '[' && p[1] == ':') {
0 0 } else if (p_ch == '[' && p[1] == ':') {
250 0 0 for (s = p += 2; (p_ch = *p) && p_ch != ']'; p++) {} /*SHARED ITERATOR*/
0 0 for (s = p += 2; (p_ch = *p) && p_ch != ']'; p++) {} /*SHARED ITERATOR*/
251 0 0 if (!p_ch)
254 0 0 if (i < 0 || p[-1] != ':') {
0 0 if (i < 0 || p[-1] != ':') {
258 0 0 if (t_ch == p_ch)
262 0 0 if (CC_EQ(s,i, "alnum")) {
0 0 if (CC_EQ(s,i, "alnum")) {
0 0 if (CC_EQ(s,i, "alnum")) {
263 0 0 if (ISALNUM(t_ch))
0 0 if (ISALNUM(t_ch))
265 0 0 } else if (CC_EQ(s,i, "alpha")) {
0 0 } else if (CC_EQ(s,i, "alpha")) {
0 0 } else if (CC_EQ(s,i, "alpha")) {
266 0 0 if (ISALPHA(t_ch))
0 0 if (ISALPHA(t_ch))
268 0 0 } else if (CC_EQ(s,i, "blank")) {
0 0 } else if (CC_EQ(s,i, "blank")) {
0 0 } else if (CC_EQ(s,i, "blank")) {
269 0 0 if (ISBLANK(t_ch))
0 0 if (ISBLANK(t_ch))
271 0 0 } else if (CC_EQ(s,i, "cntrl")) {
0 0 } else if (CC_EQ(s,i, "cntrl")) {
0 0 } else if (CC_EQ(s,i, "cntrl")) {
272 0 0 if (ISCNTRL(t_ch))
0 0 if (ISCNTRL(t_ch))
274 0 0 } else if (CC_EQ(s,i, "digit")) {
0 0 } else if (CC_EQ(s,i, "digit")) {
0 0 } else if (CC_EQ(s,i, "digit")) {
275 0 0 if (ISDIGIT(t_ch))
0 0 if (ISDIGIT(t_ch))
277 0 0 } else if (CC_EQ(s,i, "graph")) {
0 0 } else if (CC_EQ(s,i, "graph")) {
0 0 } else if (CC_EQ(s,i, "graph")) {
278 0 0 if (ISGRAPH(t_ch))
0 0 if (ISGRAPH(t_ch))
280 0 0 } else if (CC_EQ(s,i, "lower")) {
0 0 } else if (CC_EQ(s,i, "lower")) {
0 0 } else if (CC_EQ(s,i, "lower")) {
281 0 0 if (ISLOWER(t_ch))
0 0 if (ISLOWER(t_ch))
283 0 0 } else if (CC_EQ(s,i, "print")) {
0 0 } else if (CC_EQ(s,i, "print")) {
0 0 } else if (CC_EQ(s,i, "print")) {
284 0 0 if (ISPRINT(t_ch))
0 0 if (ISPRINT(t_ch))
286 0 0 } else if (CC_EQ(s,i, "punct")) {
0 0 } else if (CC_EQ(s,i, "punct")) {
0 0 } else if (CC_EQ(s,i, "punct")) {
287 0 0 if (ISPUNCT(t_ch))
0 0 if (ISPUNCT(t_ch))
289 0 0 } else if (CC_EQ(s,i, "space")) {
0 0 } else if (CC_EQ(s,i, "space")) {
0 0 } else if (CC_EQ(s,i, "space")) {
290 0 0 if (ISSPACE(t_ch))
0 0 if (ISSPACE(t_ch))
292 0 0 } else if (CC_EQ(s,i, "upper")) {
0 0 } else if (CC_EQ(s,i, "upper")) {
0 0 } else if (CC_EQ(s,i, "upper")) {
293 0 0 if (ISUPPER(t_ch))
0 0 if (ISUPPER(t_ch))
295 0 0 else if ((flags & WM_CASEFOLD) && ISLOWER(t_ch))
0 0 else if ((flags & WM_CASEFOLD) && ISLOWER(t_ch))
0 0 else if ((flags & WM_CASEFOLD) && ISLOWER(t_ch))
297 0 0 } else if (CC_EQ(s,i, "xdigit")) {
0 0 } else if (CC_EQ(s,i, "xdigit")) {
0 0 } else if (CC_EQ(s,i, "xdigit")) {
298 0 0 if (ISXDIGIT(t_ch))
0 0 if (ISXDIGIT(t_ch))
303 0 0 } else if (t_ch == p_ch)
305 0 0 } while (prev_ch = p_ch, (p_ch = *++p) != ']');
306 0 0 if (matched == negated ||
0 0 if (matched == negated ||
307 0 0 ((flags & WM_PATHNAME) && t_ch == '/'))