Branch Coverage

include/litavis_colour.h
Criterion Covered Total %
branch 130 188 69.1


line true false branch
10 38 12 strcmp(name, "darken") == 0 ||
11 36 2 strcmp(name, "saturate") == 0 ||
12 34 2 strcmp(name, "desaturate") == 0 ||
13 31 3 strcmp(name, "fade") == 0 ||
14 31 0 strcmp(name, "fadein") == 0 ||
15 31 0 strcmp(name, "fadeout") == 0 ||
16 26 5 strcmp(name, "mix") == 0 ||
17 23 3 strcmp(name, "tint") == 0 ||
18 50 22 strcmp(name, "shade") == 0 ||
20 3 strcmp(name, "shade") == 0 ||
19 4 16 strcmp(name, "greyscale") == 0);
33 0 56 if (!result.args) LITAVIS_FATAL("out of memory");
37 113 56 while (*p) {
39 57 113 while (*p == ' ' || *p == '\t') p++;
0 113 while (*p == ' ' || *p == '\t') p++;
40 0 113 if (!*p) break;
44 553 56 while (*p) {
45 0 553 if (*p == '(') paren_depth++;
46 0 553 else if (*p == ')') paren_depth--;
47 57 496 else if (*p == ',' && paren_depth == 0) break;
57 0 else if (*p == ',' && paren_depth == 0) break;
53 113 0 while (end > start && (end[-1] == ' ' || end[-1] == '\t'))
0 113 while (end > start && (end[-1] == ' ' || end[-1] == '\t'))
0 113 while (end > start && (end[-1] == ' ' || end[-1] == '\t'))
56 113 0 if (end > start && result.count < 8) {
113 0 if (end > start && result.count < 8) {
59 0 113 if (!arg) LITAVIS_FATAL("out of memory");
65 57 56 if (*p == ',') p++;
72 113 56 for (i = 0; i < args->count; i++)
93 113 56 for (i = 0; i < parsed.count; i++) {
94 0 113 if (strchr(parsed.args[i], '(')) {
101 22 34 if (strcmp(func_name, "lighten") == 0 && parsed.count >= 2) {
22 0 if (strcmp(func_name, "lighten") == 0 && parsed.count >= 2) {
103 21 1 if (colouring_parse(parsed.args[0], &c)) {
108 12 22 } else if (strcmp(func_name, "darken") == 0 && parsed.count >= 2) {
12 0 } else if (strcmp(func_name, "darken") == 0 && parsed.count >= 2) {
110 12 0 if (colouring_parse(parsed.args[0], &c)) {
115 2 20 } else if (strcmp(func_name, "saturate") == 0 && parsed.count >= 2) {
2 0 } else if (strcmp(func_name, "saturate") == 0 && parsed.count >= 2) {
117 2 0 if (colouring_parse(parsed.args[0], &c)) {
122 2 18 } else if (strcmp(func_name, "desaturate") == 0 && parsed.count >= 2) {
2 0 } else if (strcmp(func_name, "desaturate") == 0 && parsed.count >= 2) {
124 2 0 if (colouring_parse(parsed.args[0], &c)) {
129 3 15 } else if (strcmp(func_name, "fade") == 0 && parsed.count >= 2) {
3 0 } else if (strcmp(func_name, "fade") == 0 && parsed.count >= 2) {
131 3 0 if (colouring_parse(parsed.args[0], &c)) {
136 0 15 } else if (strcmp(func_name, "fadein") == 0 && parsed.count >= 2) {
0 0 } else if (strcmp(func_name, "fadein") == 0 && parsed.count >= 2) {
138 0 0 if (colouring_parse(parsed.args[0], &c)) {
143 0 15 } else if (strcmp(func_name, "fadeout") == 0 && parsed.count >= 2) {
0 0 } else if (strcmp(func_name, "fadeout") == 0 && parsed.count >= 2) {
145 0 0 if (colouring_parse(parsed.args[0], &c)) {
150 4 11 } else if (strcmp(func_name, "greyscale") == 0 && parsed.count >= 1) {
4 0 } else if (strcmp(func_name, "greyscale") == 0 && parsed.count >= 1) {
152 4 0 if (colouring_parse(parsed.args[0], &c)) {
156 5 6 } else if (strcmp(func_name, "mix") == 0 && parsed.count >= 2) {
5 0 } else if (strcmp(func_name, "mix") == 0 && parsed.count >= 2) {
158 5 0 if (colouring_parse(parsed.args[0], &c1) && colouring_parse(parsed.args[1], &c2)) {
5 0 if (colouring_parse(parsed.args[0], &c1) && colouring_parse(parsed.args[1], &c2)) {
159 5 0 int weight = parsed.count >= 3 ? atoi(parsed.args[2]) : 50;
163 3 3 } else if (strcmp(func_name, "tint") == 0 && parsed.count >= 2) {
3 0 } else if (strcmp(func_name, "tint") == 0 && parsed.count >= 2) {
165 3 0 if (colouring_parse(parsed.args[0], &c)) {
170 3 0 } else if (strcmp(func_name, "shade") == 0 && parsed.count >= 2) {
3 0 } else if (strcmp(func_name, "shade") == 0 && parsed.count >= 2) {
172 3 0 if (colouring_parse(parsed.args[0], &c)) {
181 55 1 if (ok) {
182 2 53 if (result.a < 1.0) {
201 202 70 while (*p && bpos < 8100) {
202 0 while (*p && bpos < 8100) {
203 97 105 if (isalpha((unsigned char)*p)) {
205 628 0 while (*p && (isalpha((unsigned char)*p) || *p == '_'))
531 97 while (*p && (isalpha((unsigned char)*p) || *p == '_'))
0 97 while (*p && (isalpha((unsigned char)*p) || *p == '_'))
209 72 25 if (*p == '(') {
211 0 72 if (name_len > 63) name_len = 63;
215 56 16 if (litavis_is_colour_func(func_name)) {
220 722 0 while (*p && depth > 0) {
666 56 while (*p && depth > 0) {
221 0 666 if (*p == '(') depth++;
222 56 610 else if (*p == ')') depth--;
223 610 56 if (depth > 0) p++;
228 0 56 if (!args_str) LITAVIS_FATAL("out of memory");
235 55 1 if (result) {
237 55 0 if (bpos + rlen < 8192) {
242 55 0 if (*p == ')') p++;
246 1 0 if (bpos + name_len + 1 + args_len + 1 < 8192) {
254 1 0 if (*p == ')') p++;
258 16 0 if (bpos + name_len < 8192) {
266 25 0 if (bpos + name_len < 8192) {
282 574 219 for (i = 0; i < ast->count; i++) {
284 684 574 for (j = 0; j < rule->prop_count; j++) {
286 70 614 if (strchr(rule->props[j].value, '(')) {
288 54 16 if (strcmp(resolved, rule->props[j].value) != 0) {