Branch Coverage

Shared.xs
Criterion Covered Total %
branch 89 168 52.9


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 83 0 EXTRACT_LOG(self);
0 83 EXTRACT_LOG(self);
0 83 EXTRACT_LOG(self);
85 2 81 if (len == 0) croak("append: data must not be empty");
86 0 81 if (len > (STRLEN)(UINT32_MAX - LOG_ENTRY_HDR - 3))
89 77 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);
103 229 11 if (log_read(h, offset, &out_data, &out_len, &next_off)) {
104 0 229 EXTEND(SP, 2);
113 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
123 14 0 EXTRACT_LOG(self);
0 14 EXTRACT_LOG(self);
0 14 EXTRACT_LOG(self);
133 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
143 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
154 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
157 2 0 if (items > 2) timeout = SvNV(ST(2));
158 1 1 RETVAL = log_wait(h, expected_count, timeout);
166 7 0 EXTRACT_LOG(self);
0 7 EXTRACT_LOG(self);
0 7 EXTRACT_LOG(self);
175 4 0 EXTRACT_LOG(self);
0 4 EXTRACT_LOG(self);
0 4 EXTRACT_LOG(self);
183 13 0 EXTRACT_LOG(self);
0 13 EXTRACT_LOG(self);
0 13 EXTRACT_LOG(self);
193 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
195 1 0 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
203 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
205 0 1 RETVAL = h->backing_fd;
213 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
216 0 2 if (RETVAL < 0) croak("eventfd: %s", strerror(errno));
225 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
227 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);
234 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
236 0 3 RETVAL = h->notify_fd;
244 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
246 2 0 RETVAL = log_notify(h);
254 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
257 2 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
265 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
267 0 1 if (log_msync(h) != 0) croak("msync: %s", strerror(errno));
274 1 0 if (sv_isobject(self_or_class)) {
276 0 1 if (!h) croak("Attempted to use a destroyed object");
279 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
282 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
283 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
289 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);