Branch Coverage

Shared.xs
Criterion Covered Total %
branch 116 250 46.4


line true false branch
30 0 17 if (!SvROK(self)) return;
32 0 17 if (!h) return;
40 8 0 EXTRACT_STK(self);
0 8 EXTRACT_STK(self);
0 8 EXTRACT_STK(self);
42 0 8 RETVAL = stk_size(h);
50 3 0 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
52 0 3 RETVAL = (UV)h->hdr->capacity;
60 5 0 EXTRACT_STK(self);
0 5 EXTRACT_STK(self);
0 5 EXTRACT_STK(self);
62 5 0 RETVAL = stk_size(h) == 0;
70 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
72 2 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 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
90 0 2 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 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
121 0 2 if (RETVAL < 0) croak("eventfd: %s", strerror(errno));
130 3 0 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
132 3 0 if (h->notify_fd >= 0 && h->notify_fd != fd) close(h->notify_fd);
2 1 if (h->notify_fd >= 0 && h->notify_fd != fd) close(h->notify_fd);
139 5 0 EXTRACT_STK(self);
0 5 EXTRACT_STK(self);
0 5 EXTRACT_STK(self);
141 0 5 RETVAL = h->notify_fd;
149 3 0 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
0 3 EXTRACT_STK(self);
151 3 0 RETVAL = stk_notify(h);
159 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
162 2 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
170 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
172 0 1 if (stk_msync(h) != 0) croak("msync: %s", strerror(errno));
179 1 0 if (sv_isobject(self_or_class)) {
181 0 1 if (!h) croak("Attempted to use a destroyed object");
184 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
187 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
188 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
194 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
223 4 8 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
225 1 11 if (!h) croak("Data::Stack::Shared::Int->new: %s", errbuf);
239 0 1 if (!h) croak("Data::Stack::Shared::Int->new_memfd: %s", errbuf);
252 0 1 if (!h) croak("Data::Stack::Shared::Int->new_from_fd: %s", errbuf);
262 56 0 EXTRACT_STK(self);
0 56 EXTRACT_STK(self);
0 56 EXTRACT_STK(self);
265 54 2 RETVAL = stk_try_push(h, &v, sizeof(v));
274 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
277 1 0 if (items > 2) timeout = SvNV(ST(2));
279 0 1 RETVAL = stk_push(h, &v, sizeof(v), timeout);
287 18035 0 EXTRACT_STK(self);
0 18035 EXTRACT_STK(self);
0 18035 EXTRACT_STK(self);
290 18031 4 RETVAL = stk_try_pop(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
298 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
301 2 0 if (items > 1) timeout = SvNV(ST(1));
303 1 1 RETVAL = stk_pop(h, &v, timeout) ? newSViv((IV)v) : &PL_sv_undef;
311 2 0 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
0 2 EXTRACT_STK(self);
314 2 0 RETVAL = stk_peek(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
333 0 4 if (max_len == 0) croak("max_len must be > 0");
334 0 4 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
337 0 4 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
339 0 4 if (!h) croak("Data::Stack::Shared::Str->new: %s", errbuf);
353 0 0 if (max_len == 0) croak("max_len must be > 0");
354 0 0 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
358 0 0 if (!h) croak("Data::Stack::Shared::Str->new_memfd: %s", errbuf);
371 0 0 if (!h) croak("Data::Stack::Shared::Str->new_from_fd: %s", errbuf);
381 9 0 EXTRACT_STK(self);
0 9 EXTRACT_STK(self);
0 9 EXTRACT_STK(self);
386 0 9 if (slen > max_len) slen = max_len;
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;
424 8 0 EXTRACT_STK(self);
0 8 EXTRACT_STK(self);
0 8 EXTRACT_STK(self);
428 7 1 if (stk_try_pop(h, buf)) {
432 0 7 if (len > max_len) len = max_len;
445 0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
0 0 EXTRACT_STK(self);
448 0 0 if (items > 1) timeout = SvNV(ST(1));
451 0 0 if (stk_pop(h, buf, timeout)) {
455 0 0 if (len > max_len) len = max_len;
468 1 0 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
0 1 EXTRACT_STK(self);
472 1 0 if (stk_peek(h, buf)) {
476 0 1 if (len > max_len) len = max_len;