Branch Coverage

Shared.xs
Criterion Covered Total %
branch 76 140 54.2


line true false branch
33 2 1 const char *p = SvOK(path) ? SvPV_nolen(path) : NULL;
35 0 3 if (!h) croak("Data::Graph::Shared->new: %s", errbuf);
44 0 3 if (!SvROK(self)) return;
46 0 3 if (!h) return;
55 5 0 EXTRACT_GRAPH(self);
0 5 EXTRACT_GRAPH(self);
0 5 EXTRACT_GRAPH(self);
58 5 0 RETVAL = (idx >= 0) ? newSViv((IV)idx) : &PL_sv_undef;
68 6 0 EXTRACT_GRAPH(self);
0 6 EXTRACT_GRAPH(self);
0 6 EXTRACT_GRAPH(self);
70 5 1 int64_t weight = (items > 3) ? (int64_t)SvIV(ST(3)) : 1;
71 5 1 RETVAL = graph_add_edge(h, (uint32_t)src, (uint32_t)dst, weight);
80 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
82 1 0 RETVAL = graph_remove_node(h, (uint32_t)node);
91 13 0 EXTRACT_GRAPH(self);
0 13 EXTRACT_GRAPH(self);
0 13 EXTRACT_GRAPH(self);
93 4 9 RETVAL = graph_has_node(h, (uint32_t)node);
102 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
105 3 0 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
0 3 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
120 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
123 1 0 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
0 1 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
135 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
138 3 0 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
0 3 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
144 7 3 while (eidx != GRAPH_NONE) {
152 0 3 SSize_t count = av_top_index(results) + 1;
153 3 0 if (count > 0) {
154 3 0 EXTEND(SP, count);
0 3 EXTEND(SP, count);
155 7 3 for (SSize_t i = 0; i < count; i++)
165 3 0 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
0 3 EXTRACT_GRAPH(self);
168 3 0 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
0 3 if ((uint32_t)node >= h->hdr->max_nodes || !graph_bit_set(h->node_bitmap, (uint32_t)node)) {
181 4 0 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
183 0 4 RETVAL = __atomic_load_n(&h->hdr->node_count, __ATOMIC_ACQUIRE);
191 4 0 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
0 4 EXTRACT_GRAPH(self);
193 0 4 RETVAL = __atomic_load_n(&h->hdr->edge_count, __ATOMIC_ACQUIRE);
201 2 0 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
0 2 EXTRACT_GRAPH(self);
203 0 2 RETVAL = h->hdr->max_nodes;
211 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
213 0 1 RETVAL = h->hdr->max_edges;
221 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
238 1 0 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
0 1 EXTRACT_GRAPH(self);
240 1 0 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;