Branch Coverage

secret_buffer_base.c
Criterion Covered Total %
branch 74 112 66.0


line true false branch
39 8 558 if (capacity) secret_buffer_alloc_at_least(buf, capacity);
40 556 10 if (ref_out) *ref_out= ref;
53 1187 10 if (buf->capacity != new_capacity) {
54 626 561 if (new_capacity) {
57 65 561 if (old && buf->capacity) {
65 0 if (old && buf->capacity) {
63 561 0 if (buf->data && buf->capacity) {
561 0 if (buf->data && buf->capacity) {
70 557 630 if (buf->len > buf->capacity)
74 34 1153 if (buf->stringify_sv) {
85 624 7 if (buf->capacity < min_capacity) {
96 573 975 if (new_len > buf->capacity)
99 6 1542 if (new_len < buf->len)
103 102 1446 if (buf->stringify_sv)
115 0 481 if (!len_out)
119 481 0 if (thing && SvROK(thing) && !sv_isobject(thing))
181 300 if (thing && SvROK(thing) && !sv_isobject(thing))
1 180 if (thing && SvROK(thing) && !sv_isobject(thing))
122 481 0 if (!thing || !SvOK(thing)) {
1 480 if (!thing || !SvOK(thing)) {
126 161 319 else if ((src_buf= secret_buffer_from_magic(thing, 0))) {
128 161 0 return src_buf->data? src_buf->data : "";
130 19 300 else if ((span= secret_buffer_span_from_magic(thing, 0))) {
132 19 0 if (!buf_field || !*buf_field || !(src_buf= secret_buffer_from_magic(*buf_field, 0)))
19 0 if (!buf_field || !*buf_field || !(src_buf= secret_buffer_from_magic(*buf_field, 0)))
0 19 if (!buf_field || !*buf_field || !(src_buf= secret_buffer_from_magic(*buf_field, 0)))
134 19 0 if (span->lim > src_buf->len || span->pos > span->lim)
0 19 if (span->lim > src_buf->len || span->pos > span->lim)
137 19 0 return src_buf->data? (src_buf->data + span->pos) : "";
154 0 149 if (ofs > buf->len)
156 0 149 if (ofs + len > buf->len)
160 143 6 if (replacement_len > len) /* buffer is growing */
166 5 144 if (tail_len)
169 145 4 if (replacement_len)
171 3 146 if (replacement_len < len) /* buffer shrank, wipe remainder */
199 0 2 if (!n)
201 1 1 if (buf->capacity < buf->len + n)
226 2 2 while (n > 0) {
232 0 2 if (got <= 0) {
233 0 0 if (got < 0 && errno == EINTR)
0 0 if (got < 0 && errno == EINTR)
235 0 0 if ((flags & SECRET_BUFFER_NONBLOCK) && (got == 0 || errno == EWOULDBLOCK || errno == EAGAIN))
0 0 if ((flags & SECRET_BUFFER_NONBLOCK) && (got == 0 || errno == EWOULDBLOCK || errno == EAGAIN))
0 0 if ((flags & SECRET_BUFFER_NONBLOCK) && (got == 0 || errno == EWOULDBLOCK || errno == EAGAIN))
0 0 if ((flags & SECRET_BUFFER_NONBLOCK) && (got == 0 || errno == EWOULDBLOCK || errno == EAGAIN))
256 0 198 if (stream_fd < 0)
258 0 198 if (PerlIO_get_cnt(stream))
261 19 179 if (buf->capacity < buf->len + count)
282 189 9 if (ret > 0)
301 0 4 if (stream_fd < 0)
328 195 18 if (stream_fd < 0 || n_buffered > 0) {
3 192 if (stream_fd < 0 || n_buffered > 0) {
329 0 21 if (n_buffered <= 0) {
330 0 0 if (PerlIO_fill(stream) < 0)
333 0 0 if (n_buffered <= 0)
338 0 21 if (count > n_buffered)