Branch Coverage

Shared.xs
Criterion Covered Total %
branch 105 252 41.6


line true false branch
30 0 10 if (!SvROK(self)) return;
32 0 10 if (!h) return;
40 6 0 EXTRACT_STK(self);
0 6 EXTRACT_STK(self);
0 6 EXTRACT_STK(self);
42 0 6 RETVAL = stk_size(h);
50 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
52 0 2 RETVAL = (UV)h->hdr->capacity;
60 3 0 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
62 3 0 RETVAL = stk_size(h) == 0;
70 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
72 1 0 RETVAL = stk_size(h) >= (UV)h->hdr->capacity;
80 3 0 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
88 0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
90 0 0 RETVAL = stk_drain(h);
98 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
100 1 0 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
108 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
110 0 1 RETVAL = h->backing_fd;
118 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
120 0 1 RETVAL = stk_create_eventfd(h);
129 0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
131 0 0 if (h->notify_fd >= 0 && h->notify_fd != fd) close(h->notify_fd);
0 0 if (h->notify_fd >= 0 && h->notify_fd != fd) close(h->notify_fd);
138 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
140 0 2 RETVAL = h->notify_fd;
148 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
150 2 0 RETVAL = stk_notify(h);
158 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
161 1 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
169 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
178 1 0 if (sv_isobject(self_or_class)) {
180 0 1 if (!h) croak("destroyed object");
183 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
186 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
187 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
193 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
222 3 2 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
224 0 5 if (!h) croak("Data::Stack::Shared::Int->new: %s", errbuf);
238 0 1 if (!h) croak("Data::Stack::Shared::Int->new_memfd: %s", errbuf);
251 0 1 if (!h) croak("Data::Stack::Shared::Int->new_from_fd: %s", errbuf);
261 35 0 EXTRACT_STK(self);
0 35 EXTRACT_STK(self);
0 35 EXTRACT_STK(self);
264 34 1 RETVAL = stk_try_push(h, &v, sizeof(v));
273 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
276 1 0 if (items > 2) timeout = SvNV(ST(2));
278 0 1 RETVAL = stk_push(h, &v, sizeof(v), timeout);
286 18 0 EXTRACT_STK(self);
0 18 EXTRACT_STK(self);
0 18 EXTRACT_STK(self);
289 16 2 RETVAL = stk_try_pop(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
297 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
300 2 0 if (items > 1) timeout = SvNV(ST(1));
302 1 1 RETVAL = stk_pop(h, &v, timeout) ? newSViv((IV)v) : &PL_sv_undef;
310 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
313 1 0 RETVAL = stk_peek(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
332 0 3 if (max_len == 0) croak("max_len must be > 0");
333 0 3 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
336 0 3 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
338 0 3 if (!h) croak("Data::Stack::Shared::Str->new: %s", errbuf);
352 0 0 if (max_len == 0) croak("max_len must be > 0");
353 0 0 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
357 0 0 if (!h) croak("Data::Stack::Shared::Str->new_memfd: %s", errbuf);
370 0 0 if (!h) croak("Data::Stack::Shared::Str->new_from_fd: %s", errbuf);
380 6 0 EXTRACT_STK(self);
0 6 EXTRACT_STK(self);
0 6 EXTRACT_STK(self);
385 0 6 if (slen > max_len) slen = max_len;
391 6 0 if (slen < max_len) memset(buf + sizeof(uint32_t) + slen, 0, max_len - slen);
402 0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
405 0 0 if (items > 2) timeout = SvNV(ST(2));
409 0 0 if (slen > max_len) slen = max_len;
415 0 0 if (slen < max_len) memset(buf + sizeof(uint32_t) + slen, 0, max_len - slen);
425 5 0 EXTRACT_STK(self);
0 5 EXTRACT_STK(self);
0 5 EXTRACT_STK(self);
429 4 1 if (stk_try_pop(h, buf)) {
433 0 4 if (len > max_len) len = max_len;
446 0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
449 0 0 if (items > 1) timeout = SvNV(ST(1));
452 0 0 if (stk_pop(h, buf, timeout)) {
456 0 0 if (len > max_len) len = max_len;
469 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
473 1 0 if (stk_peek(h, buf)) {
477 0 1 if (len > max_len) len = max_len;