Branch Coverage

Shared.xs
Criterion Covered Total %
branch 78 166 46.9


line true false branch
32 3 2 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
34 0 5 if (!h) croak("Data::Log::Shared->new: %s", errbuf);
48 0 1 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 7 if (!SvROK(self)) return;
72 0 7 if (!h) return;
81 58 0 EXTRACT_LOG(self);
0 58 EXTRACT_LOG(self);
0 58 EXTRACT_LOG(self);
85 1 57 if (len == 0) croak("append: data must not be empty");
86 0 57 if (len > (STRLEN)(UINT32_MAX - LOG_ENTRY_HDR))
89 55 2 RETVAL = (off >= 0) ? newSViv((IV)off) : &PL_sv_undef;
98 225 0 EXTRACT_LOG(self);
0 225 EXTRACT_LOG(self);
0 225 EXTRACT_LOG(self);
103 217 8 if (log_read(h, offset, &out_data, &out_len, &next_off)) {
104 0 217 EXTEND(SP, 2);
113 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
123 10 0 EXTRACT_LOG(self);
0 10 EXTRACT_LOG(self);
0 10 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 3 0 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
0 3 EXTRACT_LOG(self);
183 10 0 EXTRACT_LOG(self);
0 10 EXTRACT_LOG(self);
0 10 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 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
215 0 1 RETVAL = log_create_eventfd(h);
224 0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
226 0 0 if (h->notify_fd >= 0 && h->notify_fd != fd) close(h->notify_fd);
0 0 if (h->notify_fd >= 0 && h->notify_fd != fd) close(h->notify_fd);
233 0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
235 0 0 RETVAL = h->notify_fd;
243 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
245 1 0 RETVAL = log_notify(h);
253 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
256 1 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
264 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
273 1 0 if (sv_isobject(self_or_class)) {
275 0 1 if (!h) croak("destroyed object");
278 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
281 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
282 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
288 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);