Branch Coverage

json-common.c
Criterion Covered Total %
branch 144 228 63.1


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 31 2 if (parser->buffer_size < 2 * length + 0x100) {
759 0 31 if (parser->buffer) {
766 0 31 if (! parser->buffer) {
787 134 31 for (k = 0; k < strlen ("ABCD"); k++) {
808 2 0 if (p + k - parser->input >= parser->length) {
850 26 0 if (plus == UTF8_BAD_LEADING_BYTE ||
0 26 if (plus == UTF8_BAD_LEADING_BYTE ||
855 12 14 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 14 else if (plus <= 0) {
899 14 5 if (unicode >= 0x80 && ! parser->unicode) {
8 6 if (unicode >= 0x80 && ! parser->unicode) {
1024 63 5 while (p - s->start < s->length) {
1028 7 56 if (c == '\\') {
1029 7 0 HANDLE_ESCAPES (p, s->start - 1);
7 0 HANDLE_ESCAPES (p, s->start - 1);
4 3 HANDLE_ESCAPES (p, s->start - 1);
0 3 HANDLE_ESCAPES (p, s->start - 1);
0 3 HANDLE_ESCAPES (p, s->start - 1);
0 3 HANDLE_ESCAPES (p, s->start - 1);
0 3 HANDLE_ESCAPES (p, s->start - 1);
1 2 HANDLE_ESCAPES (p, s->start - 1);
2 0 HANDLE_ESCAPES (p, s->start - 1);
1086 8 0 switch (NEXTBYTE) {
1091 2 6 if (i >= strlen ("ABCD")) {
1167 28 0 if (! parser->buffer) {
1174 0 733 if (b - parser->buffer >= parser->buffer_size - 0x100) {
1189 50 2 HANDLE_ESCAPES (parser->end, start - 1);
48 2 HANDLE_ESCAPES (parser->end, start - 1);
6 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 15 109 if (parser->buffer) {
1225 4 120 if (parser->n_mallocs != 0) {
1230 0 4 if (! parser->tokenizing) {
1295 0 36 if (* start != '"') {
1296 0 0 if (end) {
1307 12 24 if (end && * end != '"') {
0 12 if (end && * end != '"') {
1314 0 10 if (* start - '0' > 9 && * start != '-') {
0 0 if (* start - '0' > 9 && * start != '-') {
1319 0 10 if (* end - '0' > 9) {
1326 8 0 if (* start != '{' || (end && * end != '}')) {
0 8 if (* start != '{' || (end && * end != '}')) {
0 0 if (* start != '{' || (end && * end != '}')) {
1327 0 0 failbug (__FILE__, __LINE__, parser,
1334 2 0 if (* start != '[' || (end && * end != ']')) {
0 2 if (* start != '[' || (end && * end != ']')) {
0 0 if (* start != '[' || (end && * end != ']')) {
1340 20 0 if (end - start != 0 || * start != ',') {
0 20 if (end - start != 0 || * start != ',') {
1347 24 0 if (end - start != 0 || * start != ':') {
0 24 if (end - start != 0 || * start != ':') {
1368 68 34 if (end) {
1384 0 34 if (jt->end != 0) {
1394 0 24 if (* end != '"') {
1400 0 8 if (* end != '}') {
1406 0 2 if (* end != ']') {
1423 10 0 switch (parent->type) {