Branch Coverage

Shared.xs
Criterion Covered Total %
branch 147 340 43.2


line true false branch
28 0 20 if (!SvROK(self)) return;
30 0 20 if (!h) return;
38 12 0 EXTRACT_DEQ(self);
0 12 EXTRACT_DEQ(self);
0 12 EXTRACT_DEQ(self);
40 0 12 RETVAL = (UV)deq_size(h);
48 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
50 0 10 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 4 0 EXTRACT_DEQ(self);
0 4 EXTRACT_DEQ(self);
0 4 EXTRACT_DEQ(self);
88 0 4 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 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
221 0 15 mode_t mode = (items > 3 && (SvGETMAGIC(ST(3)), SvOK(ST(3)))) ? (mode_t)SvUV(ST(3)) : 0600;
0 0 mode_t mode = (items > 3 && (SvGETMAGIC(ST(3)), SvOK(ST(3)))) ? (mode_t)SvUV(ST(3)) : 0600;
0 0 mode_t mode = (items > 3 && (SvGETMAGIC(ST(3)), SvOK(ST(3)))) ? (mode_t)SvUV(ST(3)) : 0600;
0 0 mode_t mode = (items > 3 && (SvGETMAGIC(ST(3)), SvOK(ST(3)))) ? (mode_t)SvUV(ST(3)) : 0600;
222 0 15 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
0 0 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
7 8 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
224 2 13 if (!h) croak("Data::Deque::Shared::Int->new: %s", errbuf);
238 0 1 if (!h) croak("Data::Deque::Shared::Int->new_memfd: %s", errbuf);
251 0 1 if (!h) croak("Data::Deque::Shared::Int->new_from_fd: %s", errbuf);
261 95 0 EXTRACT_DEQ(self);
0 95 EXTRACT_DEQ(self);
0 95 EXTRACT_DEQ(self);
264 93 2 RETVAL = deq_try_push_back(h, &v, sizeof(v));
273 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
276 8 2 RETVAL = deq_try_push_front(h, &v, sizeof(v));
285 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
288 1 0 if (items > 2) timeout = SvNV(ST(2));
290 0 1 RETVAL = deq_push_wait(h, &v, sizeof(v), 0, timeout);
299 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
302 1 0 if (items > 2) timeout = SvNV(ST(2));
304 0 1 RETVAL = deq_push_wait(h, &v, sizeof(v), 1, timeout);
312 18032 0 EXTRACT_DEQ(self);
0 18032 EXTRACT_DEQ(self);
0 18032 EXTRACT_DEQ(self);
315 18030 2 RETVAL = deq_try_pop_front(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
323 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
326 9 1 RETVAL = deq_try_pop_back(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
334 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
337 2 0 if (items > 1) timeout = SvNV(ST(1));
339 1 1 RETVAL = deq_pop_wait(h, &v, 0, timeout) ? newSViv((IV)v) : &PL_sv_undef;
347 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
350 1 0 if (items > 1) timeout = SvNV(ST(1));
352 0 1 RETVAL = deq_pop_wait(h, &v, 1, timeout) ? newSViv((IV)v) : &PL_sv_undef;
369 1 6 if (max_len == 0) croak("max_len must be > 0");
370 0 6 if (max_len >= 0x80000000u) /* bit 31 of the stored length is the UTF8 flag */
372 0 6 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
0 0 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
0 0 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
0 0 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
374 0 6 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
0 0 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
3 3 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
376 1 5 if (!h) croak("Data::Deque::Shared::Str->new: %s", errbuf);
390 0 0 if (max_len == 0) croak("max_len must be > 0");
391 0 0 if (max_len >= 0x80000000u) /* bit 31 of the stored length is the UTF8 flag */
395 0 0 if (!h) croak("Data::Deque::Shared::Str->new_memfd: %s", errbuf);
408 0 0 if (!h) croak("Data::Deque::Shared::Str->new_from_fd: %s", errbuf);
418 25 0 EXTRACT_DEQ(self);
0 25 EXTRACT_DEQ(self);
0 25 EXTRACT_DEQ(self);
423 1 24 if (slen > max_len) slen = max_len; /* fixed-size slot: truncate (documented + tested) */
439 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
444 0 3 if (slen > max_len) slen = max_len; /* fixed-size slot: truncate (documented + tested) */
460 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
463 0 0 if (items > 2) timeout = SvNV(ST(2));
467 0 0 if (slen > max_len) slen = max_len; /* fixed-size slot: truncate (documented + tested) */
483 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
486 0 0 if (items > 2) timeout = SvNV(ST(2));
490 0 0 if (slen > max_len) slen = max_len; /* fixed-size slot: truncate (documented + tested) */
505 26 0 EXTRACT_DEQ(self);
0 26 EXTRACT_DEQ(self);
0 26 EXTRACT_DEQ(self);
510 25 1 if (deq_try_pop_front(h, buf)) {
516 0 25 if (len > max_len) len = max_len;
518 0 25 if (is_utf8) SvUTF8_on(RETVAL);
529 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
534 1 1 if (deq_try_pop_back(h, buf)) {
540 0 1 if (len > max_len) len = max_len;
542 0 1 if (is_utf8) SvUTF8_on(RETVAL);
553 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
556 0 0 if (items > 1) timeout = SvNV(ST(1));
560 0 0 if (deq_pop_wait(h, buf, 0, timeout)) {
566 0 0 if (len > max_len) len = max_len;
568 0 0 if (is_utf8) SvUTF8_on(RETVAL);
579 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
582 0 0 if (items > 1) timeout = SvNV(ST(1));
586 0 0 if (deq_pop_wait(h, buf, 1, timeout)) {
592 0 0 if (len > max_len) len = max_len;
594 0 0 if (is_utf8) SvUTF8_on(RETVAL);