Branch Coverage

lib/Doubly.xs
Criterion Covered Total %
branch 297 630 47.1


line true false branch
68 41 0 if (!registry_initialized) {
80 0 2731 while (list_registry[id % MAX_LISTS] != NULL && tries < MAX_LISTS) {
0 0 while (list_registry[id % MAX_LISTS] != NULL && tries < MAX_LISTS) {
85 0 2731 if (tries >= MAX_LISTS) {
95 124110 0 if (id < 0 || id >= MAX_LISTS) {
0 124110 if (id < 0 || id >= MAX_LISTS) {
109 1029 0 return (init_sv && SvTRUE(init_sv));
0 1029 return (init_sv && SvTRUE(init_sv));
116 0 0 if (!storage) return;
120 0 0 PUSHMARK(SP);
121 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)storage)));
124 0 0 FREETMPS;
134 0 0 PUSHMARK(SP);
135 0 0 mXPUSHi(index);
136 0 0 XPUSHs(value);
142 0 0 FREETMPS;
155 1029 0 if (!_is_sharing_initialized(aTHX)) {
162 0 0 PUSHMARK(SP);
163 0 0 XPUSHs(sv);
170 0 0 if (count != 1 || SvTRUE(ERRSV)) {
0 0 if (count != 1 || SvTRUE(ERRSV)) {
0 0 if (count != 1 || SvTRUE(ERRSV)) {
172 0 0 FREETMPS;
180 0 0 FREETMPS;
185 0 0 if (!id_sv) {
196 0 0 if (SvMAGICAL(id_sv)) {
213 0 0 if (id < 0 || !_is_sharing_initialized(aTHX)) {
0 0 if (id < 0 || !_is_sharing_initialized(aTHX)) {
221 0 0 PUSHMARK(SP);
222 0 0 mXPUSHi(id);
229 0 0 if (count == 1 && !SvTRUE(ERRSV)) {
0 0 if (count == 1 && !SvTRUE(ERRSV)) {
0 0 if (count == 1 && !SvTRUE(ERRSV)) {
231 0 0 if (SvOK(ret)) {
237 0 0 FREETMPS;
247 0 0 if (id < 0 || !_is_sharing_initialized(aTHX)) {
0 0 if (id < 0 || !_is_sharing_initialized(aTHX)) {
255 0 0 PUSHMARK(SP);
256 0 0 mXPUSHi(id);
261 0 0 FREETMPS;
276 111185 0 if (sv && SvOK(sv)) {
110479 706 if (sv && SvOK(sv)) {
277 1017 109462 if (SvROK(sv)) {
280 0 1017 if (ref_id >= 0) {
290 105683 3779 } else if (SvNOK(sv) || SvIOK(sv)) {
105447 236 } else if (SvNOK(sv) || SvIOK(sv)) {
317 109308 0 if (node) {
318 0 109308 if (node->is_number == 2) {
320 0 0 if (!PL_dirty) {
324 1000 108308 } else if (node->is_number == 3) {
326 1000 0 if (!PL_dirty && node->data) {
1000 0 if (!PL_dirty && node->data) {
330 108305 3 } else if (node->data) {
339 0 836 if (!node) {
343 0 836 if (node->is_number == 2) {
349 39 797 if (node->is_number == 3) {
356 791 6 if (node->is_number == 1) {
360 1 5 if (!node->data) {
375 0 2731 if (id < 0) {
400 1740 0 if (list) {
420 4471 0 if (list) {
422 2731 1740 if (list->refcount <= 0) {
426 1877 2731 while (node) {
427 27 1850 if (node->is_number == 3 && !PL_dirty && node->data) {
27 0 if (node->is_number == 3 && !PL_dirty && node->data) {
27 0 if (node->is_number == 3 && !PL_dirty && node->data) {
429 0 1850 } else if (node->is_number == 2 && !PL_dirty) {
0 0 } else if (node->is_number == 2 && !PL_dirty) {
436 11 2720 if (total_nodes > 0) {
443 1877 2731 while (node) {
445 0 1877 if (node->is_number == 2 && !PL_dirty) {
0 0 if (node->is_number == 2 && !PL_dirty) {
448 27 1850 } else if (node->is_number == 3 && !PL_dirty && node->data) {
27 0 } else if (node->is_number == 3 && !PL_dirty && node->data) {
27 0 } else if (node->is_number == 3 && !PL_dirty && node->data) {
452 1850 0 } else if (node->is_number != 2 && node->is_number != 3 && node->data) {
1850 0 } else if (node->is_number != 2 && node->is_number != 3 && node->data) {
1843 7 } else if (node->is_number != 2 && node->is_number != 3 && node->data) {
465 27 4471 for (i = 0; i < sv_count; i++) {
468 11 4460 if (sv_to_dec) free(sv_to_dec);
471 0 4471 for (i = 0; i < ref_count; i++) {
474 11 4460 if (ref_ids_to_clear) free(ref_ids_to_clear);
484 124 0 if (list && !list->destroyed) {
124 0 if (list && !list->destroyed) {
497 6 0 if (!list || list->destroyed || !list->head) {
6 0 if (!list || list->destroyed || !list->head) {
0 6 if (!list || list->destroyed || !list->head) {
502 9 3 for (i = 0; i < pos && node && node->next; i++) {
9 0 for (i = 0; i < pos && node && node->next; i++) {
6 3 for (i = 0; i < pos && node && node->next; i++) {
513 964 0 if (!list || list->destroyed || !list->head) {
964 0 if (!list || list->destroyed || !list->head) {
0 964 if (!list || list->destroyed || !list->head) {
518 304253 1 while (node) {
519 963 303290 if (node->node_id == node_id) {
533 0 0 if (!list || list->destroyed || !list->head) {
0 0 if (!list || list->destroyed || !list->head) {
0 0 if (!list || list->destroyed || !list->head) {
538 0 0 while (node) {
539 0 0 if (node->node_id == node_id) {
557 0 0 if (list && !list->destroyed) {
0 0 if (list && !list->destroyed) {
559 0 0 if (node) {
575 0 0 if (list && !list->destroyed) {
0 0 if (list && !list->destroyed) {
577 0 0 if (node) {
579 0 0 if (node->is_number == 2) {
582 0 0 } else if (node->is_number == 3) {
583 0 0 if (node->data) {
587 0 0 } else if (node->data) {
597 0 0 if (sv && SvOK(sv)) {
0 0 if (sv && SvOK(sv)) {
598 0 0 if (SvROK(sv)) {
600 0 0 if (ref_id >= 0) {
608 0 0 } else if (SvNOK(sv) || SvIOK(sv)) {
0 0 } else if (SvNOK(sv) || SvIOK(sv)) {
641 0 0 if (list && !list->destroyed && list->length > 0) {
0 0 if (list && !list->destroyed && list->length > 0) {
0 0 if (list && !list->destroyed && list->length > 0) {
656 3919 0 if (list && !list->destroyed && list->head) {
3919 0 if (list && !list->destroyed && list->head) {
3919 0 if (list && !list->destroyed && list->head) {
671 748 0 if (list && !list->destroyed && list->tail) {
748 0 if (list && !list->destroyed && list->tail) {
748 0 if (list && !list->destroyed && list->tail) {
687 244 0 if (list && !list->destroyed) {
244 0 if (list && !list->destroyed) {
689 244 0 if (node && node->next) {
243 1 if (node && node->next) {
706 207 0 if (list && !list->destroyed) {
207 0 if (list && !list->destroyed) {
708 207 0 if (node && node->prev) {
207 0 if (node && node->prev) {
725 86 0 if (list && !list->destroyed) {
85 1 if (list && !list->destroyed) {
727 84 1 if (node) {
743 4 0 if (list && !list->destroyed) {
4 0 if (list && !list->destroyed) {
745 4 0 if (node) {
747 0 4 if (node->is_number == 2) {
750 2 2 } else if (node->is_number == 3) {
751 2 0 if (node->data) {
755 1 1 } else if (node->data) {
765 4 0 if (sv && SvOK(sv)) {
4 0 if (sv && SvOK(sv)) {
766 3 1 if (SvROK(sv)) {
768 0 3 if (ref_id >= 0) {
776 1 0 } else if (SvNOK(sv) || SvIOK(sv)) {
1 0 } else if (SvNOK(sv) || SvIOK(sv)) {
806 6 0 if (list && !list->destroyed && list->head) {
6 0 if (list && !list->destroyed && list->head) {
6 0 if (list && !list->destroyed && list->head) {
821 4 0 if (list && !list->destroyed && list->tail) {
4 0 if (list && !list->destroyed && list->tail) {
4 0 if (list && !list->destroyed && list->tail) {
838 103 0 if (list && !list->destroyed) {
103 0 if (list && !list->destroyed) {
839 1 102 if (list->length == 0) {
845 102 0 if (node) {
849 0 102 if (node->prev) {
874 115 0 if (list && !list->destroyed) {
115 0 if (list && !list->destroyed) {
875 1 114 if (list->length == 0) {
881 114 0 if (node) {
885 0 114 if (node->next) {
914 210 0 if (list && !list->destroyed && list->length > 0) {
210 0 if (list && !list->destroyed && list->length > 0) {
208 2 if (list && !list->destroyed && list->length > 0) {
916 208 0 if (node) {
920 204 4 if (node->next) {
922 1 3 } else if (node->prev) {
926 3 205 if (node->prev && node->next) {
2 1 if (node->prev && node->next) {
932 1 205 } else if (node->prev) {
938 202 3 } else if (node->next) {
946 3 0 if (node->data) {
981 0 0 if (list && !list->destroyed) {
0 0 if (list && !list->destroyed) {
996 108624 0 if (list && !list->destroyed) {
108624 0 if (list && !list->destroyed) {
998 690 107934 if (list->length == 0 && list->head) {
690 0 if (list->length == 0 && list->head) {
1000 0 690 if (list->head->is_number == 2) {
1003 0 690 } else if (list->head->is_number == 3) {
1004 0 0 if (list->head->data) {
1008 0 690 } else if (list->head->data) {
1018 690 0 if (data && SvOK(data)) {
690 0 if (data && SvOK(data)) {
1019 8 682 if (SvROK(data)) {
1022 0 8 if (ref_id >= 0) {
1031 283 399 } else if (SvNOK(data) || SvIOK(data)) {
265 18 } else if (SvNOK(data) || SvIOK(data)) {
1071 322 0 if (list && !list->destroyed && list->head && list->length > 0) {
322 0 if (list && !list->destroyed && list->head && list->length > 0) {
322 0 if (list && !list->destroyed && list->head && list->length > 0) {
320 2 if (list && !list->destroyed && list->head && list->length > 0) {
1075 318 2 if (old_head->next) {
1082 2 0 if (old_head->data) {
1104 219 0 if (list && !list->destroyed && list->tail && list->length > 0) {
219 0 if (list && !list->destroyed && list->tail && list->length > 0) {
219 0 if (list && !list->destroyed && list->tail && list->length > 0) {
219 0 if (list && !list->destroyed && list->tail && list->length > 0) {
1108 217 2 if (old_tail->prev) {
1115 2 0 if (old_tail->data) {
1137 4 0 if (list && !list->destroyed && list->length > 0) {
4 0 if (list && !list->destroyed && list->length > 0) {
3 1 if (list && !list->destroyed && list->length > 0) {
1139 3 0 if (node) {
1142 2 1 if (node->prev && node->next) {
0 2 if (node->prev && node->next) {
1148 2 1 } else if (node->prev) {
1154 0 1 } else if (node->next) {
1162 1 0 if (node->data) {
1185 0 0 if (list && !list->destroyed) {
0 0 if (list && !list->destroyed) {
1186 0 0 if (list->length == 0) {
1193 0 0 if (node) {
1196 0 0 if (node->prev) {
1218 0 0 if (list && !list->destroyed) {
0 0 if (list && !list->destroyed) {
1219 0 0 if (list->length == 0) {
1226 0 0 if (node) {
1229 0 0 if (node->next) {
1250 315 0 if (list && !list->destroyed) {
315 0 if (list && !list->destroyed) {
1251 13 302 if (list->length == 0) {
1254 0 13 if (list->head->is_number == 2) {
1257 0 13 } else if (list->head->is_number == 3) {
1258 0 0 if (list->head->data) {
1262 0 13 } else if (list->head->data) {
1270 13 0 if (data && SvOK(data)) {
13 0 if (data && SvOK(data)) {
1271 1 12 if (SvROK(data)) {
1274 0 1 if (ref_id >= 0) {
1283 12 0 } else if (SvNOK(data) || SvIOK(data)) {
12 0 } else if (SvNOK(data) || SvIOK(data)) {
1327 3 0 if (list && !list->destroyed) {
3 0 if (list && !list->destroyed) {
1328 1 2 if (list->length == 0) {
1336 3 0 for (i = 0; i < pos && node->next; i++) {
1 2 for (i = 0; i < pos && node->next; i++) {
1345 0 2 if (node->next) {
1365 2635 0 if (list && !list->destroyed) {
2635 0 if (list && !list->destroyed) {
1370 108566 2635 while (node) {
1402 2025 706 data = (items > 1) ? ST(1) : &PL_sv_undef;
1425 124 0 int id = id_sv ? SvIV(*id_sv) : -1;
1437 86 0 int id = id_sv ? SvIV(*id_sv) : -1;
1438 86 0 long node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1440 4 82 if (items > 1) {
1463 229 0 id = id_sv ? SvIV(*id_sv) : -1;
1497 209 0 id = id_sv ? SvIV(*id_sv) : -1;
1534 244 0 id = id_sv ? SvIV(*id_sv) : -1;
1535 244 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1539 1 243 if (next_node_id == 0) {
1577 207 0 id = id_sv ? SvIV(*id_sv) : -1;
1578 207 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1582 0 207 if (prev_node_id == 0) {
1609 6 0 int id = id_sv ? SvIV(*id_sv) : -1;
1610 6 0 long node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1622 4 0 int id = id_sv ? SvIV(*id_sv) : -1;
1623 4 0 long node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1642 6295 0 id = id_sv ? SvIV(*id_sv) : -1;
1643 6295 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1646 1 6294 if (node_id == 0) {
1659 204 0 int id = id_sv ? SvIV(*id_sv) : -1;
1661 102010 204 for (i = 1; i < items; i++) {
1683 322 0 id = id_sv ? SvIV(*id_sv) : -1;
1684 322 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1688 320 2 if (node_id == old_head_id) {
1710 219 0 id = id_sv ? SvIV(*id_sv) : -1;
1711 219 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1715 4 215 if (node_id == old_tail_id) {
1736 210 0 id = id_sv ? SvIV(*id_sv) : -1;
1737 210 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1752 4 0 int id = id_sv ? SvIV(*id_sv) : -1;
1776 103 0 id = id_sv ? SvIV(*id_sv) : -1;
1777 103 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1814 115 0 id = id_sv ? SvIV(*id_sv) : -1;
1815 115 0 node_id = node_id_sv ? SvIV(*node_id_sv) : 0;
1849 315 0 id = id_sv ? SvIV(*id_sv) : -1;
1884 315 0 id = id_sv ? SvIV(*id_sv) : -1;
1922 3 0 id = id_sv ? SvIV(*id_sv) : -1;
1929 3 0 if (list && !list->destroyed) {
3 0 if (list && !list->destroyed) {
1931 3 0 if (node) {
1972 1 0 id = id_sv ? SvIV(*id_sv) : -1;
1980 1 0 if (list && !list->destroyed && list->length > 0) {
1 0 if (list && !list->destroyed && list->length > 0) {
1 0 if (list && !list->destroyed && list->length > 0) {
1982 3 0 while (node && !found) {
2 1 while (node && !found) {
1990 0 2 PUSHMARK(SP);
1991 0 2 XPUSHs(sv_2mortal(node_data));
1995 1 1 if (SvTRUE(*PL_stack_sp)) {
2004 2 0 if (!list || list->destroyed) {
2 0 if (!list || list->destroyed) {
2008 1 1 if (!found) {
2015 1 0 if (found) {
2051 1 0 id = id_sv ? SvIV(*id_sv) : -1;
2059 1 0 if (list && !list->destroyed && list->length > 0) {
1 0 if (list && !list->destroyed && list->length > 0) {
0 1 if (list && !list->destroyed && list->length > 0) {
2061 0 0 while (node && !found) {
0 0 while (node && !found) {
2069 0 0 PUSHMARK(SP);
2070 0 0 XPUSHs(sv_2mortal(node_data));
2074 0 0 if (SvTRUE(*PL_stack_sp)) {
2082 0 0 if (!list || list->destroyed) {
0 0 if (!list || list->destroyed) {
2086 0 0 if (!found) {
2095 0 1 if (found) {
2112 2635 0 int id = id_sv ? SvIV(*id_sv) : -1;
2129 0 4471 if (PL_dirty) {
2135 4471 0 id = id_sv ? SvIV(*id_sv) : -1;