Branch Coverage

Shared.xs
Criterion Covered Total %
branch 121 226 53.5


line true false branch
40 3 7 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
42 0 10 if (!h) croak("Data::Graph::Shared->new: %s", errbuf);
57 0 2 if (!h) croak("Data::Graph::Shared->new_memfd: %s", errbuf);
70 0 1 if (!h) croak("Data::Graph::Shared->new_from_fd: %s", errbuf);
79 0 13 if (!SvROK(self)) return;
81 0 13 if (!h) return;
89 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
91 0 1 if (graph_msync(h) != 0) croak("msync: %s", strerror(errno));
98 1 0 if (sv_isobject(self_or_class)) {
100 0 1 if (!h) croak("Attempted to use a destroyed object");
103 0 0 if (items < 2) croak("Usage: ...->unlink($path)");
106 0 1 if (!p) croak("cannot unlink anonymous or memfd object");
107 0 1 if (unlink(p) != 0) croak("unlink(%s): %s", p, strerror(errno));
113 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
115 0 2 RETVAL = h->backing_fd;
123 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
126 0 2 if (RETVAL < 0) croak("eventfd: %s", strerror(errno));
135 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
137 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);
144 5 0 EXTRACT_GRAPH(self);
0 5 EXTRACT_GRAPH(self);
0 5 EXTRACT_GRAPH(self);
146 0 5 RETVAL = h->notify_fd;
154 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
156 3 0 RETVAL = graph_notify(h);
164 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
167 2 0 RETVAL = (n >= 0) ? newSViv((IV)n) : &PL_sv_undef;
176 80 0 EXTRACT_GRAPH(self);
0 80 EXTRACT_GRAPH(self);
0 80 EXTRACT_GRAPH(self);
179 80 0 RETVAL = (idx >= 0) ? newSViv((IV)idx) : &PL_sv_undef;
189 11 0 EXTRACT_GRAPH(self);
0 11 EXTRACT_GRAPH(self);
0 11 EXTRACT_GRAPH(self);
191 10 1 int64_t weight = (items > 3) ? (int64_t)SvIV(ST(3)) : 1;
192 10 1 RETVAL = graph_add_edge(h, (uint32_t)src, (uint32_t)dst, weight);
201 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
203 2 0 RETVAL = graph_remove_node(h, (uint32_t)node);
212 4 0 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
214 3 1 RETVAL = graph_remove_node_full(h, (uint32_t)node);
223 22 0 EXTRACT_GRAPH(self);
0 22 EXTRACT_GRAPH(self);
0 22 EXTRACT_GRAPH(self);
225 10 12 RETVAL = graph_has_node(h, (uint32_t)node);
234 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
237 3 0 REQUIRE_NODE(h, node);
0 3 REQUIRE_NODE(h, node);
249 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
252 2 0 REQUIRE_NODE(h, node);
0 2 REQUIRE_NODE(h, node);
262 4 0 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
268 4 0 REQUIRE_NODE(h, node);
0 4 REQUIRE_NODE(h, node);
271 4 0 uint32_t *dsts = deg ? (uint32_t *)malloc(deg * sizeof(uint32_t)) : NULL;
272 4 0 int64_t *wts = deg ? (int64_t *)malloc(deg * sizeof(int64_t)) : NULL;
273 4 0 if (deg && (!dsts || !wts)) {
4 0 if (deg && (!dsts || !wts)) {
0 4 if (deg && (!dsts || !wts)) {
279 8 4 while (eidx != GRAPH_NONE && i < deg) {
8 0 while (eidx != GRAPH_NONE && i < deg) {
286 0 4 EXTEND(SP, (SSize_t)i);
287 8 4 for (uint32_t j = 0; j < i; j++) {
300 4 0 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
303 4 0 REQUIRE_NODE(h, node);
0 4 REQUIRE_NODE(h, node);
313 6 0 EXTRACT_GRAPH(self);
0 6 EXTRACT_GRAPH(self);
0 6 EXTRACT_GRAPH(self);
315 0 6 RETVAL = __atomic_load_n(&h->hdr->node_count, __ATOMIC_ACQUIRE);
323 9 0 EXTRACT_GRAPH(self);
0 9 EXTRACT_GRAPH(self);
0 9 EXTRACT_GRAPH(self);
325 0 9 RETVAL = __atomic_load_n(&h->hdr->edge_count, __ATOMIC_ACQUIRE);
333 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
335 0 2 RETVAL = h->hdr->max_nodes;
343 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
345 0 1 RETVAL = h->hdr->max_edges;
353 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
370 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
372 1 1 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;