Branch Coverage

picohttpparser-git/picohttpparser.c
Criterion Covered Total %
branch 78 170 45.8


line true false branch
49 370 84 if (likely(buf_end - buf >= 16)) {
51 4327 73 for (i = 0; i < 16; i++, ++buf) {
52 297 4030 if (unlikely((unsigned char)*buf <= '\015')
53 0 297 && (*buf == '\015' || *buf == '\012')) {
0 0 && (*buf == '\015' || *buf == '\012')) {
59 0 450 CHECK_EOF();
60 84 366 if (unlikely((unsigned char)*buf <= '\015')
61 0 84 && (*buf == '\015' || *buf == '\012')) {
0 0 && (*buf == '\015' || *buf == '\012')) {
68 381 0 if (*buf == '\015') {
70 0 381 EXPECT_CHAR('\012');
0 381 EXPECT_CHAR('\012');
85 0 0 buf = last_len < 3 ? buf : buf + last_len - 3;
88 0 0 CHECK_EOF();
89 0 0 if (*buf == '\015') {
91 0 0 CHECK_EOF();
92 0 0 EXPECT_CHAR('\012');
0 0 EXPECT_CHAR('\012');
94 0 0 } else if (*buf == '\012') {
101 0 0 if (ret_cnt == 2) {
115 0 110 CHECK_EOF();
116 110 0 if (! ('0' <= *buf && *buf <= '9')) {
0 110 if (! ('0' <= *buf && *buf <= '9')) {
122 0 220 CHECK_EOF();
123 110 110 if ('0' <= *buf && *buf <= '9') {
110 0 if ('0' <= *buf && *buf <= '9') {
138 0 111 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
1 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
0 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
0 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
0 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
0 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
0 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
0 110 EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P');
139 0 110 EXPECT_CHAR('/'); EXPECT_CHAR('1'); EXPECT_CHAR('.');
0 110 EXPECT_CHAR('/'); EXPECT_CHAR('1'); EXPECT_CHAR('.');
0 110 EXPECT_CHAR('/'); EXPECT_CHAR('1'); EXPECT_CHAR('.');
0 110 EXPECT_CHAR('/'); EXPECT_CHAR('1'); EXPECT_CHAR('.');
0 110 EXPECT_CHAR('/'); EXPECT_CHAR('1'); EXPECT_CHAR('.');
0 110 EXPECT_CHAR('/'); EXPECT_CHAR('1'); EXPECT_CHAR('.');
149 1 490 CHECK_EOF();
150 109 381 if (*buf == '\015') {
152 0 109 EXPECT_CHAR('\012');
0 109 EXPECT_CHAR('\012');
154 0 381 } else if (*buf == '\012') {
158 0 381 if (*num_headers == max_headers) {
162 272 109 if (*num_headers == 0 || ! (*buf == ' ' || *buf == '\t')) {
272 0 if (*num_headers == 0 || ! (*buf == ' ' || *buf == '\t')) {
272 0 if (*num_headers == 0 || ! (*buf == ' ' || *buf == '\t')) {
167 0 3586 CHECK_EOF();
168 381 3205 if (*buf == ':') {
170 0 3205 } else if (*buf < ' ') {
178 0 762 CHECK_EOF();
179 381 381 if (! (*buf == ' ' || *buf == '\t')) {
381 0 if (! (*buf == ' ' || *buf == '\t')) {
187 0 381 if ((buf = get_token_to_eol(buf, buf_end, &headers[*num_headers].value,
203 0 111 CHECK_EOF();
204 0 111 if (*buf == '\015') {
206 0 0 EXPECT_CHAR('\012');
0 0 EXPECT_CHAR('\012');
207 0 111 } else if (*buf == '\012') {
212 0 455 ADVANCE_TOKEN(*method, *method_len);
111 344 ADVANCE_TOKEN(*method, *method_len);
344 0 ADVANCE_TOKEN(*method, *method_len);
0 344 ADVANCE_TOKEN(*method, *method_len);
214 0 783 ADVANCE_TOKEN(*path, *path_len);
111 672 ADVANCE_TOKEN(*path, *path_len);
672 0 ADVANCE_TOKEN(*path, *path_len);
0 672 ADVANCE_TOKEN(*path, *path_len);
216 1 110 if ((buf = parse_http_version(buf, buf_end, minor_version, ret)) == NULL) {
219 110 0 if (*buf == '\015') {
221 0 110 EXPECT_CHAR('\012');
0 110 EXPECT_CHAR('\012');
222 0 0 } else if (*buf == '\012') {
250 0 111 if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
0 0 if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
254 2 109 if ((buf = parse_request(buf, buf_end, method, method_len, path, path_len,
272 0 0 if ((buf = parse_http_version(buf, buf_end, minor_version, ret)) == NULL) {
276 0 0 if (*buf++ != ' ') {
281 0 0 if ((buf = parse_int(buf, buf_end, status, ret)) == NULL) {
285 0 0 if (*buf++ != ' ') {
290 0 0 if ((buf = get_token_to_eol(buf, buf_end, msg, msg_len, ret)) == NULL) {
314 0 0 if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
0 0 if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
318 0 0 if ((buf = parse_response(buf, buf_end, minor_version, status, msg, msg_len,