The code in "white space" section is truly impossible, as
we don't return WEOF untile ->node is NULL, and when that
happens, ->col is set to 0.
Other code is only "mostly dead".
This brings coverage to 95%
Signed-off-by: NeilBrown <neil@brown.name>
@mv *.gcov coverage; [ -f .gcov ] && mv .gcov coverage || true
@awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
- if (ran < (ran + skip) *0.94) exit(1) }' \
+ if (ran < (ran + skip) *0.95) exit(1) }' \
coverage/scanner.mdc.gcov
@rm -f .tmp*
###### white space
if (ch == WEOF) {
- if (state->col) {
- state->col = 0;
- state->check_indent = 1;
- continue;
- }
tk.num = TK_eof;
return tk;
}
&mbstate);
if (n == -2 || n == 0) {
/* Not enough bytes - not really possible */
- next = '\n';
- state->offset = state->node->code.len;
+ next = '\n'; // NOTEST
+ state->offset = state->node->code.len; // NOTEST
} else if (n == -1) {
/* error */
- state->offset += 1;
- next = 0x7f; // an illegal character
+ state->offset += 1; // NOTEST
+ next = 0x7f; // an illegal character // NOTEST
} else
state->offset += n;