Branch Coverage

Shared.xs
Criterion Covered Total %
branch 140 308 45.4


line true false branch
28 0 18 if (!SvROK(self)) return;
30 0 18 if (!h) return;
38 8 0 EXTRACT_DEQ(self);
0 8 EXTRACT_DEQ(self);
0 8 EXTRACT_DEQ(self);
40 0 8 RETVAL = (UV)deq_size(h);
48 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
50 0 2 RETVAL = (UV)h->hdr->capacity;
58 7 0 EXTRACT_DEQ(self);
0 7 EXTRACT_DEQ(self);
0 7 EXTRACT_DEQ(self);
60 7 0 RETVAL = deq_size(h) == 0;
68 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
70 3 0 RETVAL = deq_size(h) >= h->hdr->capacity;
78 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
86 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
88 0 2 RETVAL = (UV)deq_drain(h);
96 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
98 1 0 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
106 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
108 0 1 RETVAL = h->backing_fd;
116 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
119 0 2 if (RETVAL < 0) croak("eventfd: %s", strerror(errno));
128 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
130 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);
137 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
139 0 3 RETVAL = h->notify_fd;
147 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
149 2 0 RETVAL = deq_notify(h);
157 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
160 2 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
168 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
170 0 1 if (deq_msync(h) != 0) croak("msync: %s", strerror(errno));
177 2 0 if (sv_isobject(self_or_class)) {
179 0 2 if (!h) croak("Attempted to use a destroyed object");
182 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
185 0 2 if (!p) croak("cannot unlink anonymous or memfd object");
186 0 2 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
192 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
220 4 8 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
222 1 11 if (!h) croak("Data::Deque::Shared::Int->new: %s", errbuf);
236 0 1 if (!h) croak("Data::Deque::Shared::Int->new_memfd: %s", errbuf);
249 0 1 if (!h) croak("Data::Deque::Shared::Int->new_from_fd: %s", errbuf);
259 62 0 EXTRACT_DEQ(self);
0 62 EXTRACT_DEQ(self);
0 62 EXTRACT_DEQ(self);
262 60 2 RETVAL = deq_try_push_back(h, &v, sizeof(v));
271 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
274 8 2 RETVAL = deq_try_push_front(h, &v, sizeof(v));
283 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
286 1 0 if (items > 2) timeout = SvNV(ST(2));
288 0 1 RETVAL = deq_push_wait(h, &v, sizeof(v), 0, timeout);
297 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
300 1 0 if (items > 2) timeout = SvNV(ST(2));
302 0 1 RETVAL = deq_push_wait(h, &v, sizeof(v), 1, timeout);
310 18024 0 EXTRACT_DEQ(self);
0 18024 EXTRACT_DEQ(self);
0 18024 EXTRACT_DEQ(self);
313 18022 2 RETVAL = deq_try_pop_front(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
321 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
324 9 1 RETVAL = deq_try_pop_back(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
332 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
335 2 0 if (items > 1) timeout = SvNV(ST(1));
337 1 1 RETVAL = deq_pop_wait(h, &v, 0, timeout) ? newSViv((IV)v) : &PL_sv_undef;
345 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
348 1 0 if (items > 1) timeout = SvNV(ST(1));
350 0 1 RETVAL = deq_pop_wait(h, &v, 1, timeout) ? newSViv((IV)v) : &PL_sv_undef;
367 1 5 if (max_len == 0) croak("max_len must be > 0");
368 0 5 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
371 2 3 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
373 0 5 if (!h) croak("Data::Deque::Shared::Str->new: %s", errbuf);
387 0 0 if (max_len == 0) croak("max_len must be > 0");
388 0 0 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
392 0 0 if (!h) croak("Data::Deque::Shared::Str->new_memfd: %s", errbuf);
405 0 0 if (!h) croak("Data::Deque::Shared::Str->new_from_fd: %s", errbuf);
415 19 0 EXTRACT_DEQ(self);
0 19 EXTRACT_DEQ(self);
0 19 EXTRACT_DEQ(self);
420 1 18 if (slen > max_len) slen = max_len;
436 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
441 0 3 if (slen > max_len) slen = max_len;
457 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
460 0 0 if (items > 2) timeout = SvNV(ST(2));
464 0 0 if (slen > max_len) slen = max_len;
480 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
483 0 0 if (items > 2) timeout = SvNV(ST(2));
487 0 0 if (slen > max_len) slen = max_len;
502 20 0 EXTRACT_DEQ(self);
0 20 EXTRACT_DEQ(self);
0 20 EXTRACT_DEQ(self);
506 19 1 if (deq_try_pop_front(h, buf)) {
510 0 19 if (len > max_len) len = max_len;
523 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
527 1 1 if (deq_try_pop_back(h, buf)) {
531 0 1 if (len > max_len) len = max_len;
544 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
547 0 0 if (items > 1) timeout = SvNV(ST(1));
550 0 0 if (deq_pop_wait(h, buf, 0, timeout)) {
554 0 0 if (len > max_len) len = max_len;
567 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
570 0 0 if (items > 1) timeout = SvNV(ST(1));
573 0 0 if (deq_pop_wait(h, buf, 1, timeout)) {
577 0 0 if (len > max_len) len = max_len;