Branch Coverage

Shared.xs
Criterion Covered Total %
branch 72 154 46.7


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 51 0 EXTRACT_LOG(self);
0 51 EXTRACT_LOG(self);
0 51 EXTRACT_LOG(self);
85 1 50 if (len == 0) croak("append: data must not be empty");
86 0 50 if (len > (STRLEN)(UINT32_MAX - LOG_ENTRY_HDR))
89 48 2 RETVAL = (off >= 0) ? newSViv((IV)off) : &PL_sv_undef;
98 215 0 EXTRACT_LOG(self);
0 215 EXTRACT_LOG(self);
0 215 EXTRACT_LOG(self);
103 211 4 if (log_read(h, offset, &out_data, &out_len, &next_off)) {
104 0 211 EXTEND(SP, 2);
113 2 0 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
0 2 EXTRACT_LOG(self);
123 8 0 EXTRACT_LOG(self);
0 8 EXTRACT_LOG(self);
0 8 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 5 0 EXTRACT_LOG(self);
0 5 EXTRACT_LOG(self);
0 5 EXTRACT_LOG(self);
174 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
176 1 0 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
184 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
186 0 1 RETVAL = h->backing_fd;
194 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
196 0 1 RETVAL = log_create_eventfd(h);
205 0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
207 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);
214 0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
0 0 EXTRACT_LOG(self);
216 0 0 RETVAL = h->notify_fd;
224 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
226 1 0 RETVAL = log_notify(h);
234 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
237 1 0 RETVAL = (v >= 0) ? newSViv((IV)v) : &PL_sv_undef;
245 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
254 1 0 if (sv_isobject(self_or_class)) {
256 0 1 if (!h) croak("destroyed object");
259 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
262 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
263 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
269 1 0 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);
0 1 EXTRACT_LOG(self);