Branch Coverage

json-common.c
Criterion Covered Total %
branch 132 228 57.8


line true false branch
400 0 0 for (i = 0; i < JSON3MAXBYTE; i++) {
403 0 0 for (i = 0; i < n_expectations; i++) {
406 0 0 if (SPECIFIC (X)) {
0 0 if (SPECIFIC (X)) {
409 0 0 if (parser->expected & X) {
411 0 0 for (j = 0; j < JSON3MAXBYTE; j++) {
416 0 0 if (SPECIFIC (parser->expected)) {
0 0 if (SPECIFIC (parser->expected)) {
525 167 13 if (parser->error == json_error_unexpected_character &&
15 152 if (parser->error == json_error_unexpected_character &&
536 0 180 if (parser->error <= json_error_invalid &&
0 0 if (parser->error <= json_error_invalid &&
544 0 180 if (l >= ERRORMSGBUFFERSIZE - 1) {
547 3621 180 for (i = 0; i < l; i++) {
556 152 28 if (parser->error == json_error_unexpected_character) {
566 0 152 if (! parser->bad_byte) {
585 144 8 if (bb >= 0x20 && bb < 0x7F) {
65 79 if (bb >= 0x20 && bb < 0x7F) {
588 0 65 EROVERFLOW;
593 0 87 EROVERFLOW;
596 3 25 else if (parser->error == json_error_name_is_not_unique) {
603 180 0 if (parser->bad_type <= json_invalid ||
0 180 if (parser->bad_type <= json_invalid ||
611 0 180 EROVERFLOW;
612 87 93 if (parser->bad_beginning) {
617 0 87 EROVERFLOW;
625 152 28 if (parser->expected) {
626 152 0 if (parser->error == json_error_unexpected_character) {
633 0 152 EROVERFLOW;
636 148 4 if (SPECIFIC (parser->expected)) {
3 145 if (SPECIFIC (parser->expected)) {
637 0 7 if (! parser->literal_char) {
642 0 7 EROVERFLOW;
644 3496 152 for (i = 0; i < n_expectations; i++) {
647 3344 152 if (SPECIFIC (X)) {
152 3192 if (SPECIFIC (X)) {
650 0 3192 if (i == xin_literal) {
654 647 2545 if (parser->expected & X) {
658 0 647 if (allowed[i][bb]) {
665 502 145 if (joined) {
667 0 502 EROVERFLOW;
670 0 647 EROVERFLOW;
681 0 28 else if (parser->error == json_error_unexpected_character) {
704 1 179 if (parser->diagnostics_hash) {
711 176 3 if (parser->length > 0) {
712 15 161 if (parser->end - parser->input > parser->length) {
716 155 6 else if (parser->bad_byte) {
757 29 0 if (parser->buffer_size < 2 * length + 0x100) {
759 0 29 if (parser->buffer) {
766 0 29 if (! parser->buffer) {
787 126 29 for (k = 0; k < strlen ("ABCD"); k++) {
808 2 0 if (p + k - parser->input >= parser->length) {
850 24 0 if (plus == UTF8_BAD_LEADING_BYTE ||
0 24 if (plus == UTF8_BAD_LEADING_BYTE ||
855 12 12 else if (plus == UNICODE_SURROGATE_PAIR) {
858 4 8 if (parser->last_byte - p < 6) {
864 5 3 if (*p++ == '\\') {
865 5 0 if (*p++ == 'u') {
869 0 5 if (plus2 <= 0) {
870 0 0 if (plus2 == UNICODE_NOT_SURROGATE_PAIR) {
892 0 12 else if (plus <= 0) {
899 13 4 if (unicode >= 0x80 && ! parser->unicode) {
8 5 if (unicode >= 0x80 && ! parser->unicode) {
1024 60 2 while (p - s->start < s->length) {
1028 4 56 if (c == '\\') {
1029 4 0 HANDLE_ESCAPES (p, s->start - 1);
4 0 HANDLE_ESCAPES (p, s->start - 1);
4 0 HANDLE_ESCAPES (p, s->start - 1);
0 0 HANDLE_ESCAPES (p, s->start - 1);
0 0 HANDLE_ESCAPES (p, s->start - 1);
0 0 HANDLE_ESCAPES (p, s->start - 1);
0 0 HANDLE_ESCAPES (p, s->start - 1);
0 0 HANDLE_ESCAPES (p, s->start - 1);
0 0 HANDLE_ESCAPES (p, s->start - 1);
1086 0 0 switch (NEXTBYTE) {
1091 0 0 if (i >= strlen ("ABCD")) {
1167 27 0 if (! parser->buffer) {
1174 0 722 if (b - parser->buffer >= parser->buffer_size - 0x100) {
1189 46 2 HANDLE_ESCAPES (parser->end, start - 1);
44 2 HANDLE_ESCAPES (parser->end, start - 1);
2 42 HANDLE_ESCAPES (parser->end, start - 1);
2 40 HANDLE_ESCAPES (parser->end, start - 1);
2 38 HANDLE_ESCAPES (parser->end, start - 1);
13 25 HANDLE_ESCAPES (parser->end, start - 1);
2 23 HANDLE_ESCAPES (parser->end, start - 1);
2 21 HANDLE_ESCAPES (parser->end, start - 1);
17 4 HANDLE_ESCAPES (parser->end, start - 1);
1219 13 109 if (parser->buffer) {
1225 3 119 if (parser->n_mallocs != 0) {
1230 0 3 if (! parser->tokenizing) {
1295 0 34 if (* start != '"') {
1296 0 0 if (end) {
1307 11 23 if (end && * end != '"') {
0 11 if (end && * end != '"') {
1314 0 9 if (* start - '0' > 9 && * start != '-') {
0 0 if (* start - '0' > 9 && * start != '-') {
1319 0 9 if (* end - '0' > 9) {
1326 7 0 if (* start != '{' || (end && * end != '}')) {
0 7 if (* start != '{' || (end && * end != '}')) {
0 0 if (* start != '{' || (end && * end != '}')) {
1327 0 0 failbug (__FILE__, __LINE__, parser,
1334 1 0 if (* start != '[' || (end && * end != ']')) {
0 1 if (* start != '[' || (end && * end != ']')) {
0 0 if (* start != '[' || (end && * end != ']')) {
1340 18 0 if (end - start != 0 || * start != ',') {
0 18 if (end - start != 0 || * start != ',') {
1347 23 0 if (end - start != 0 || * start != ':') {
0 23 if (end - start != 0 || * start != ':') {
1368 62 31 if (end) {
1384 0 31 if (jt->end != 0) {
1394 0 23 if (* end != '"') {
1400 0 7 if (* end != '}') {
1406 0 1 if (* end != ']') {
1423 8 0 switch (parent->type) {