Branch Coverage

include/eshu_xs.h
Criterion Covered Total %
branch 148 228 64.9


line true false branch
56 357 964 if (eol - p < 8) return 0;
57 930 34 if (memcmp(p, "MODULE", 6) != 0) return 0;
59 68 0 while (p < eol && (*p == ' ' || *p == '\t')) p++;
34 34 while (p < eol && (*p == ' ' || *p == '\t')) p++;
0 34 while (p < eol && (*p == ' ' || *p == '\t')) p++;
60 34 0 return (p < eol && *p == '=');
34 0 return (p < eol && *p == '=');
75 287 875 if (!isalpha((unsigned char)*p)) return 0;
78 4995 75 while (p < eol && (isalpha((unsigned char)*p) || *p == '_'))
4086 909 while (p < eol && (isalpha((unsigned char)*p) || *p == '_'))
109 800 while (p < eol && (isalpha((unsigned char)*p) || *p == '_'))
83 1229 75 while (p < eol && (*p == ' ' || *p == '\t')) p++;
429 800 while (p < eol && (*p == ' ' || *p == '\t')) p++;
0 800 while (p < eol && (*p == ' ' || *p == '\t')) p++;
84 800 75 if (p >= eol || *p != ':') return 0;
669 131 if (p >= eol || *p != ':') return 0;
88 7 124 if (p + 1 < eol && *(p + 1) == ':') return 0;
0 7 if (p + 1 < eol && *(p + 1) == ':') return 0;
91 57 74 if ((len == 4 && memcmp(start, "CODE", 4) == 0) ||
56 1 if ((len == 4 && memcmp(start, "CODE", 4) == 0) ||
1 74 if ((len == 4 && memcmp(start, "CODE", 4) == 0) ||
92 1 0 (len == 4 && memcmp(start, "INIT", 4) == 0) ||
43 31 (len == 4 && memcmp(start, "INIT", 4) == 0) ||
93 42 1 (len == 6 && memcmp(start, "OUTPUT", 6) == 0) ||
24 8 (len == 6 && memcmp(start, "OUTPUT", 6) == 0) ||
94 19 5 (len == 7 && memcmp(start, "PREINIT", 7) == 0) ||
5 8 (len == 7 && memcmp(start, "PREINIT", 7) == 0) ||
95 1 4 (len == 7 && memcmp(start, "CLEANUP", 7) == 0) ||
0 12 (len == 7 && memcmp(start, "CLEANUP", 7) == 0) ||
96 0 0 (len == 8 && memcmp(start, "POSTCALL", 8) == 0) ||
1 11 (len == 8 && memcmp(start, "POSTCALL", 8) == 0) ||
97 1 0 (len == 6 && memcmp(start, "PPCODE", 6) == 0) ||
0 11 (len == 6 && memcmp(start, "PPCODE", 6) == 0) ||
98 0 0 (len == 4 && memcmp(start, "CASE", 4) == 0) ||
0 11 (len == 4 && memcmp(start, "CASE", 4) == 0) ||
99 0 0 (len == 9 && memcmp(start, "INTERFACE", 9) == 0) ||
0 11 (len == 9 && memcmp(start, "INTERFACE", 9) == 0) ||
100 0 0 (len == 15 && memcmp(start, "INTERFACE_MACRO", 15) == 0) ||
4 7 (len == 15 && memcmp(start, "INTERFACE_MACRO", 15) == 0) ||
101 4 0 (len == 10 && memcmp(start, "PROTOTYPES", 10) == 0) ||
0 7 (len == 10 && memcmp(start, "PROTOTYPES", 10) == 0) ||
102 0 0 (len == 12 && memcmp(start, "VERSIONCHECK", 12) == 0) ||
4 3 (len == 12 && memcmp(start, "VERSIONCHECK", 12) == 0) ||
103 1 3 (len == 7 && memcmp(start, "INCLUDE", 7) == 0) ||
0 6 (len == 7 && memcmp(start, "INCLUDE", 7) == 0) ||
104 0 0 (len == 8 && memcmp(start, "FALLBACK", 8) == 0) ||
0 6 (len == 8 && memcmp(start, "FALLBACK", 8) == 0) ||
105 0 0 (len == 8 && memcmp(start, "OVERLOAD", 8) == 0) ||
3 3 (len == 8 && memcmp(start, "OVERLOAD", 8) == 0) ||
106 3 0 (len == 5 && memcmp(start, "ALIAS", 5) == 0) ||
0 3 (len == 5 && memcmp(start, "ALIAS", 5) == 0) ||
107 0 0 (len == 5 && memcmp(start, "ATTRS", 5) == 0)) {
113 57 71 if (len == 4 && memcmp(start, "BOOT", 4) == 0)
0 57 if (len == 4 && memcmp(start, "BOOT", 4) == 0)
123 130 1038 if (eol - p < 5) return 0;
124 1032 6 if (memcmp(p, "BOOT", 4) != 0) return 0;
126 6 0 while (p < eol && (*p == ' ' || *p == '\t')) p++;
0 6 while (p < eol && (*p == ' ' || *p == '\t')) p++;
0 6 while (p < eol && (*p == ' ' || *p == '\t')) p++;
127 6 0 return (p < eol && *p == ':' && (p + 1 >= eol || *(p + 1) != ':'));
6 0 return (p < eol && *p == ':' && (p + 1 >= eol || *(p + 1) != ':'));
0 6 return (p < eol && *p == ':' && (p + 1 >= eol || *(p + 1) != ':'));
0 0 return (p < eol && *p == ':' && (p + 1 >= eol || *(p + 1) != ':'));
138 0 0 if (!isalpha((unsigned char)*p) && *p != '_')
0 0 if (!isalpha((unsigned char)*p) && *p != '_')
142 0 0 while (p < eol && (isalnum((unsigned char)*p) || *p == '_' || *p == '*' || *p == ' ' || *p == '\t'))
0 0 while (p < eol && (isalnum((unsigned char)*p) || *p == '_' || *p == '*' || *p == ' ' || *p == '\t'))
0 0 while (p < eol && (isalnum((unsigned char)*p) || *p == '_' || *p == '*' || *p == ' ' || *p == '\t'))
0 0 while (p < eol && (isalnum((unsigned char)*p) || *p == '_' || *p == '*' || *p == ' ' || *p == '\t'))
0 0 while (p < eol && (isalnum((unsigned char)*p) || *p == '_' || *p == '*' || *p == ' ' || *p == '\t'))
0 0 while (p < eol && (isalnum((unsigned char)*p) || *p == '_' || *p == '*' || *p == ' ' || *p == '\t'))
158 5196 324 while (p < end) {
163 24 4858 if (c == '{') {
165 10 4848 } else if (c == '}') {
167 0 10 if (ctx->c_depth < 0) ctx->c_depth = 0;
168 33 4815 } else if (c == '"') {
170 0 4815 } else if (c == '\'') {
172 2 4813 } else if (c == '/' && p + 1 < end && *(p + 1) == '/') {
2 0 } else if (c == '/' && p + 1 < end && *(p + 1) == '/') {
0 2 } else if (c == '/' && p + 1 < end && *(p + 1) == '/') {
174 2 4813 } else if (c == '/' && p + 1 < end && *(p + 1) == '*') {
2 0 } else if (c == '/' && p + 1 < end && *(p + 1) == '*') {
2 0 } else if (c == '/' && p + 1 < end && *(p + 1) == '*') {
181 11 235 if (c == '\\' && p + 1 < end) p++;
11 0 if (c == '\\' && p + 1 < end) p++;
182 33 202 else if (c == '"') ctx->c_ctx.state = ESHU_CODE;
186 0 0 if (c == '\\' && p + 1 < end) p++;
0 0 if (c == '\\' && p + 1 < end) p++;
187 0 0 else if (c == '\'') ctx->c_ctx.state = ESHU_CODE;
191 2 66 if (c == '*' && p + 1 < end && *(p + 1) == '/') {
2 0 if (c == '*' && p + 1 < end && *(p + 1) == '/') {
2 0 if (c == '*' && p + 1 < end && *(p + 1) == '/') {
214 134 1321 if (content >= eol) {
222 152 1169 if (ctx->mode == ESHU_XS_C_MODE) {
224 33 119 if (eshu_xs_is_module_line(content, eol)) {
242 1 1168 if (eshu_xs_is_module_line(content, eol)) {
252 0 1168 if (ctx->c_ctx.state == ESHU_COMMENT_BLOCK) {
253 0 0 int depth = (ctx->section == ESHU_XS_BODY) ? 2 + ctx->c_depth : 1;
262 6 1162 if (eshu_xs_is_boot_label(content, eol)) {
277 128 1034 if (eshu_xs_is_label(content, eol, &is_boot)) {
292 3 1031 if (*content == '#') {
310 1244 57 while (pp < eol) {
311 99 1145 if (*pp == '(') {
337 17 307 int base = ctx->is_boot ? 1 : 2;
341 10 314 if (*content == '}') {
343 0 10 if (depth < base) depth = base;
365 134 1321 if (content >= eol) {
366 111 23 if (ctx->mode == ESHU_XS_XSUB_MODE) {
377 1169 152 if (ctx->mode == ESHU_XS_XSUB_MODE &&
378 1053 116 ctx->c_depth == 0 &&
379 431 622 (ctx->section == ESHU_XS_PARAMS || ctx->section == ESHU_XS_BODY)) {
403 1455 33 while (p < end) {
410 1455 0 if (eshu_in_range(cfg, line_num)) {
421 1455 0 if (*p == '\n') p++;