Branch Coverage

hoedown/src/buffer.c
Criterion Covered Total %
branch 37 78 47.4


line true false branch
17 29 0 if (ret) {
29 18 0 if (!buf)
40 0 0 if (!buf)
55 73 0 assert(buf && buf->unit);
0 73 assert(buf && buf->unit);
57 73 0 if (neosz > BUFFER_MAX_ALLOC_SIZE)
60 35 38 if (buf->asize >= neosz)
64 15 35 while (neoasz < neosz)
68 35 0 if (!neodata)
80 153 0 assert(buf && buf->unit);
0 153 assert(buf && buf->unit);
82 17 136 if (buf->size + len > buf->asize && hoedown_buffer_grow(buf, buf->size + len) < 0)
17 0 if (buf->size + len > buf->asize && hoedown_buffer_grow(buf, buf->size + len) < 0)
101 42 0 assert(buf && buf->unit);
0 42 assert(buf && buf->unit);
103 0 42 if (buf->size + 1 > buf->asize && hoedown_buffer_grow(buf, buf->size + 1) < 0)
0 0 if (buf->size + 1 > buf->asize && hoedown_buffer_grow(buf, buf->size + 1) < 0)
114 1 0 assert(buf && buf->unit);
1 0 assert(buf && buf->unit);
116 1 0 for (i = 0; i < buf->size; ++i) {
117 1 0 if (prefix[i] == 0)
120 1 0 if (buf->data[i] != prefix[i])
131 0 0 assert(buf && buf->unit);
0 0 assert(buf && buf->unit);
133 0 0 if (len >= buf->size) {
146 6 0 assert(buf && buf->unit);
0 6 assert(buf && buf->unit);
148 6 0 if (buf->size < buf->asize && buf->data[buf->size] == 0)
0 6 if (buf->size < buf->asize && buf->data[buf->size] == 0)
151 0 0 if (buf->size + 1 <= buf->asize || hoedown_buffer_grow(buf, buf->size + 1) == 0) {
0 0 if (buf->size + 1 <= buf->asize || hoedown_buffer_grow(buf, buf->size + 1) == 0) {
166 25 0 assert(buf && buf->unit);
0 25 assert(buf && buf->unit);
168 1 24 if (buf->size >= buf->asize && hoedown_buffer_grow(buf, buf->size + 1) < 0)
1 0 if (buf->size >= buf->asize && hoedown_buffer_grow(buf, buf->size + 1) < 0)
175 25 0 if (n < 0) {
185 1 24 if ((size_t)n >= buf->asize - buf->size) {
186 1 0 if (hoedown_buffer_grow(buf, buf->size + n + 1) < 0)
194 25 0 if (n < 0)