Branch Coverage

reader.c
Criterion Covered Total %
branch 99 158 62.6


line true false branch
52 216 2 while (!parser->eof
53 109 107 && parser->raw_buffer.last - parser->raw_buffer.pointer < 3) {
54 0 109 if (!yaml_parser_update_raw_buffer(parser)) {
61 107 2 if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 2
62 1 106 && !memcmp(parser->raw_buffer.pointer, BOM_UTF16LE, 2)) {
67 106 2 else if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 2
68 1 105 && !memcmp(parser->raw_buffer.pointer, BOM_UTF16BE, 2)) {
73 105 2 else if (parser->raw_buffer.last - parser->raw_buffer.pointer >= 3
74 0 105 && !memcmp(parser->raw_buffer.pointer, BOM_UTF8, 3)) {
97 111 102 if (parser->raw_buffer.start == parser->raw_buffer.pointer
98 0 111 && parser->raw_buffer.last == parser->raw_buffer.end)
103 2 211 if (parser->eof)
108 102 109 if (parser->raw_buffer.start < parser->raw_buffer.pointer
109 0 102 && parser->raw_buffer.pointer < parser->raw_buffer.last) {
119 0 211 if (!parser->read_handler(parser->read_handler_data, parser->raw_buffer.last,
125 104 107 if (!size_read) {
144 0 354 assert(parser->read_handler); /* Read handler must be set. */
148 143 211 if (parser->eof && parser->raw_buffer.pointer == parser->raw_buffer.last)
143 0 if (parser->eof && parser->raw_buffer.pointer == parser->raw_buffer.last)
153 0 211 if (parser->unread >= length)
158 109 102 if (!parser->encoding) {
159 0 109 if (!yaml_parser_determine_encoding(parser))
165 102 109 if (parser->buffer.start < parser->buffer.pointer
166 102 0 && parser->buffer.pointer < parser->buffer.last) {
172 109 0 else if (parser->buffer.pointer == parser->buffer.last) {
179 211 106 while (parser->unread < length)
183 211 0 if (!first || parser->raw_buffer.pointer == parser->raw_buffer.last) {
104 107 if (!first || parser->raw_buffer.pointer == parser->raw_buffer.last) {
184 0 104 if (!yaml_parser_update_raw_buffer(parser))
191 4713 210 while (parser->raw_buffer.pointer != parser->raw_buffer.last)
230 67 4634 width = (octet & 0x80) == 0x00 ? 1 :
57 10 width = (octet & 0x80) == 0x00 ? 1 :
0 57 width = (octet & 0x80) == 0x00 ? 1 :
0 0 width = (octet & 0x80) == 0x00 ? 1 :
237 0 4701 if (!width)
244 0 4701 if (width > raw_unread) {
245 0 0 if (parser->eof) {
256 4634 67 value = (octet & 0x80) == 0x00 ? octet & 0x7F :
10 57 value = (octet & 0x80) == 0x00 ? octet & 0x7F :
57 0 value = (octet & 0x80) == 0x00 ? octet & 0x7F :
0 0 value = (octet & 0x80) == 0x00 ? octet & 0x7F :
263 124 4701 for (k = 1; k < width; k ++)
269 0 124 if ((octet & 0xC0) != 0x80)
281 67 4634 if (!((width == 1) ||
10 57 if (!((width == 1) ||
0 0 if (!((width == 1) ||
282 0 10 (width == 2 && value >= 0x80) ||
57 0 (width == 2 && value >= 0x80) ||
283 0 57 (width == 3 && value >= 0x800) ||
284 0 0 (width == 4 && value >= 0x10000)))
291 0 4701 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
0 0 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
0 4701 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
332 0 12 if (raw_unread < 2) {
333 0 0 if (parser->eof) {
349 0 12 if ((value & 0xFC00) == 0xDC00)
356 0 12 if ((value & 0xFC00) == 0xD800) {
362 0 0 if (raw_unread < 4) {
363 0 0 if (parser->eof) {
379 0 0 if ((value2 & 0xFC00) != 0xDC00)
401 0 4713 if (incomplete) break;
410 4713 0 if (! (value == 0x09 || value == 0x0A || value == 0x0D
4361 352 if (! (value == 0x09 || value == 0x0A || value == 0x0D
4361 0 if (! (value == 0x09 || value == 0x0A || value == 0x0D
0 4 if (! (value == 0x09 || value == 0x0A || value == 0x0D
411 4357 4 || (value >= 0x20 && value <= 0x7E)
69 4288 || (value >= 0x20 && value <= 0x7E)
412 73 0 || (value == 0x85) || (value >= 0xA0 && value <= 0xD7FF)
69 4 || (value == 0x85) || (value >= 0xA0 && value <= 0xD7FF)
0 69 || (value == 0x85) || (value >= 0xA0 && value <= 0xD7FF)
413 0 4 || (value >= 0xE000 && value <= 0xFFFD)
0 0 || (value >= 0xE000 && value <= 0xFFFD)
414 0 0 || (value >= 0x10000 && value <= 0x10FFFF))) {
418 1 3 if (!parser->problem_nonstrict)
430 4643 69 if (value <= 0x7F) {
434 12 57 else if (value <= 0x7FF) {
439 57 0 else if (value <= 0xFFFF) {
457 104 106 if (parser->eof) {
465 0 106 if (parser->offset >= MAX_FILE_SIZE) {