Branch Coverage

Shared.xs
Criterion Covered Total %
branch 91 174 52.3


line true false branch
32 3 3 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
34 0 6 if (!h) croak("Data::Log::Shared->new: %s", errbuf);
48 0 7 if (!h) croak("Data::Log::Shared->new_memfd: %s", errbuf);
61 0 1 if (!h) croak("Data::Log::Shared->new_from_fd: %s", errbuf);
70 0 14 if (!SvROK(self)) return;
72 0 14 if (!h) return;
81 115 0 EXTRACT_LOG(self);
0 115 EXTRACT_LOG(self);
0 115 EXTRACT_LOG(self);
85 2 113 if (len == 0) croak("append: data must not be empty");
86 0 113 if (len > (STRLEN)(UINT32_MAX - LOG_ENTRY_HDR - 3))
89 109 4 RETVAL = (off >= 0) ? newSViv((IV)off) : &PL_sv_undef;
98 240 0 EXTRACT_LOG(self);
0 240 EXTRACT_LOG(self);
0 240 EXTRACT_LOG(self);
105 0 240 uint64_t wait_us = (items > 2) ? (uint64_t)SvUV(ST(2)) : (uint64_t)LOG_ABANDON_WAIT_US;
107 229 11 if (rc == LOG_READ_OK) {
108 0 229 EXTEND(SP, 2);
111 0 11 } else if (rc == LOG_READ_ABANDONED) {
113 0 0 EXTEND(SP, 2);
123 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
133 14 0 EXTRACT_LOG(self);
0 14 EXTRACT_LOG(self);
0 14 EXTRACT_LOG(self);
143 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
153 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
164 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
167 2 0 if (items > 2) timeout = SvNV(ST(2));
168 1 1 RETVAL = log_wait(h, expected_count, timeout);
176 7 0 EXTRACT_LOG(self);
0 7 EXTRACT_LOG(self);
0 7 EXTRACT_LOG(self);
185 4 0 EXTRACT_LOG(self);
0 4 EXTRACT_LOG(self);
0 4 EXTRACT_LOG(self);
193 13 0 EXTRACT_LOG(self);
0 13 EXTRACT_LOG(self);
0 13 EXTRACT_LOG(self);
203 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
205 1 0 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
213 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
215 0 1 RETVAL = h->backing_fd;
223 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
226 0 2 if (RETVAL < 0) croak("eventfd: %s", strerror(errno));
235 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
237 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);
244 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
246 0 3 RETVAL = h->notify_fd;
254 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
256 2 0 RETVAL = log_notify(h);
264 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
267 2 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
275 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
277 0 1 if (log_msync(h) != 0) croak("msync: %s", strerror(errno));
284 1 0 if (sv_isobject(self_or_class)) {
286 0 1 if (!h) croak("Attempted to use a destroyed object");
289 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
292 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
293 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
299 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);