Branch Coverage

Shared.xs
Criterion Covered Total %
branch 92 172 53.4


line true false branch
32 3 6 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
34 0 9 if (!h) croak("Data::Heap::Shared->new: %s", errbuf);
48 0 7 if (!h) croak("Data::Heap::Shared->new_memfd: %s", errbuf);
61 0 1 if (!h) croak("Data::Heap::Shared->new_from_fd: %s", errbuf);
70 0 17 if (!SvROK(self)) return;
72 0 17 if (!h) return;
82 57 0 EXTRACT_HEAP(self);
0 57 EXTRACT_HEAP(self);
0 57 EXTRACT_HEAP(self);
84 53 4 RETVAL = heap_push(h, (int64_t)priority, (int64_t)value);
92 33 0 EXTRACT_HEAP(self);
0 33 EXTRACT_HEAP(self);
0 33 EXTRACT_HEAP(self);
95 31 2 if (heap_pop(h, &p, &v)) {
96 0 31 EXTEND(SP, 2);
105 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
108 2 0 if (items > 1) timeout = SvNV(ST(1));
110 1 1 if (heap_pop_wait(h, &p, &v, timeout)) {
111 0 1 EXTEND(SP, 2);
120 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
123 2 0 if (heap_peek(h, &p, &v)) {
124 0 2 EXTEND(SP, 2);
133 17 0 EXTRACT_HEAP(self);
0 17 EXTRACT_HEAP(self);
0 17 EXTRACT_HEAP(self);
135 9 8 RETVAL = heap_size(h);
143 1 0 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
145 0 1 RETVAL = (UV)h->hdr->capacity;
153 4 0 EXTRACT_HEAP(self);
0 4 EXTRACT_HEAP(self);
0 4 EXTRACT_HEAP(self);
155 4 0 RETVAL = heap_size(h) == 0;
163 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
165 2 0 RETVAL = heap_size(h) >= (UV)h->hdr->capacity;
173 3 0 EXTRACT_HEAP(self);
0 3 EXTRACT_HEAP(self);
0 3 EXTRACT_HEAP(self);
181 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
183 1 1 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
191 1 0 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
193 0 1 RETVAL = h->backing_fd;
201 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
204 0 2 if (RETVAL < 0) croak("eventfd: %s", strerror(errno));
213 3 0 EXTRACT_HEAP(self);
0 3 EXTRACT_HEAP(self);
0 3 EXTRACT_HEAP(self);
215 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);
222 4 0 EXTRACT_HEAP(self);
0 4 EXTRACT_HEAP(self);
0 4 EXTRACT_HEAP(self);
224 0 4 RETVAL = h->notify_fd;
232 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
234 2 0 RETVAL = heap_notify(h);
242 2 0 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
0 2 EXTRACT_HEAP(self);
245 2 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
253 1 0 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
255 0 1 if (heap_msync(h) != 0) croak("msync: %s", strerror(errno));
262 1 0 if (sv_isobject(self_or_class)) {
264 0 1 if (!h) croak("Attempted to use a destroyed object");
267 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
270 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
271 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
277 1 0 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);
0 1 EXTRACT_HEAP(self);