Branch Coverage

Shared.xs
Criterion Covered Total %
branch 141 308 45.7


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 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 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 7 8 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
223 2 13 if (!h) croak("Data::Deque::Shared::Int->new: %s", errbuf);
237 0 1 if (!h) croak("Data::Deque::Shared::Int->new_memfd: %s", errbuf);
250 0 1 if (!h) croak("Data::Deque::Shared::Int->new_from_fd: %s", errbuf);
260 72 0 EXTRACT_DEQ(self);
0 72 EXTRACT_DEQ(self);
0 72 EXTRACT_DEQ(self);
263 70 2 RETVAL = deq_try_push_back(h, &v, sizeof(v));
272 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
275 8 2 RETVAL = deq_try_push_front(h, &v, sizeof(v));
284 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
287 1 0 if (items > 2) timeout = SvNV(ST(2));
289 0 1 RETVAL = deq_push_wait(h, &v, sizeof(v), 0, timeout);
298 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
301 1 0 if (items > 2) timeout = SvNV(ST(2));
303 0 1 RETVAL = deq_push_wait(h, &v, sizeof(v), 1, timeout);
311 18027 0 EXTRACT_DEQ(self);
0 18027 EXTRACT_DEQ(self);
0 18027 EXTRACT_DEQ(self);
314 18025 2 RETVAL = deq_try_pop_front(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
322 10 0 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
0 10 EXTRACT_DEQ(self);
325 9 1 RETVAL = deq_try_pop_back(h, &v) ? newSViv((IV)v) : &PL_sv_undef;
333 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
336 2 0 if (items > 1) timeout = SvNV(ST(1));
338 1 1 RETVAL = deq_pop_wait(h, &v, 0, timeout) ? newSViv((IV)v) : &PL_sv_undef;
346 1 0 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
0 1 EXTRACT_DEQ(self);
349 1 0 if (items > 1) timeout = SvNV(ST(1));
351 0 1 RETVAL = deq_pop_wait(h, &v, 1, timeout) ? newSViv((IV)v) : &PL_sv_undef;
368 1 6 if (max_len == 0) croak("max_len must be > 0");
369 0 6 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
372 3 3 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
374 1 5 if (!h) croak("Data::Deque::Shared::Str->new: %s", errbuf);
388 0 0 if (max_len == 0) croak("max_len must be > 0");
389 0 0 if (max_len > (UV)(UINT32_MAX - sizeof(uint32_t)))
393 0 0 if (!h) croak("Data::Deque::Shared::Str->new_memfd: %s", errbuf);
406 0 0 if (!h) croak("Data::Deque::Shared::Str->new_from_fd: %s", errbuf);
416 19 0 EXTRACT_DEQ(self);
0 19 EXTRACT_DEQ(self);
0 19 EXTRACT_DEQ(self);
421 1 18 if (slen > max_len) slen = max_len;
437 3 0 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
0 3 EXTRACT_DEQ(self);
442 0 3 if (slen > max_len) slen = max_len;
458 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
461 0 0 if (items > 2) timeout = SvNV(ST(2));
465 0 0 if (slen > max_len) slen = max_len;
481 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
484 0 0 if (items > 2) timeout = SvNV(ST(2));
488 0 0 if (slen > max_len) slen = max_len;
503 20 0 EXTRACT_DEQ(self);
0 20 EXTRACT_DEQ(self);
0 20 EXTRACT_DEQ(self);
507 19 1 if (deq_try_pop_front(h, buf)) {
511 0 19 if (len > max_len) len = max_len;
524 2 0 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
0 2 EXTRACT_DEQ(self);
528 1 1 if (deq_try_pop_back(h, buf)) {
532 0 1 if (len > max_len) len = max_len;
545 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
548 0 0 if (items > 1) timeout = SvNV(ST(1));
551 0 0 if (deq_pop_wait(h, buf, 0, timeout)) {
555 0 0 if (len > max_len) len = max_len;
568 0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
0 0 EXTRACT_DEQ(self);
571 0 0 if (items > 1) timeout = SvNV(ST(1));
574 0 0 if (deq_pop_wait(h, buf, 1, timeout)) {
578 0 0 if (len > max_len) len = max_len;