Branch Coverage

Indexed.xs
Criterion Covered Total %
branch 212 342 61.9


line true false branch
259 2 88 switch (mode)
272 0 117 if ((he = hv_fetch_ent(THIS->hv, key, 1, 0)) == NULL)
279 88 29 if (SvTYPE(pair) == SVt_NULL)
289 4 84 if (mode == SM_GET_NUM)
295 0 84 if (mode == SM_GET && !value)
0 0 if (mode == SM_GET && !value)
307 12 17 if (mode < SM_GET)
309 2 10 if (mode != SM_SET)
326 15 15 for (cur = THIS->root->next; cur != THIS->root;)
344 0 164 if ((he = hv_fetch_ent(THIS->hv, key, 0, 0)) == NULL)
373 1 23 THI_CHECK_ITERATOR;
375 23 0 if (GIMME_V == G_ARRAY && THIS->cur != THIS->end)
7 16 if (GIMME_V == G_ARRAY && THIS->cur != THIS->end)
6 1 if (GIMME_V == G_ARRAY && THIS->cur != THIS->end)
377 0 6 EXTEND(SP, 2);
383 6 17 THIS->cur = ix == THIS->reverse ? THIS->cur->next : THIS->cur->prev;
390 18 0 RETVAL = SvIVX(THIS->serial) == THIS->orig_serial &&
15 3 RETVAL = SvIVX(THIS->serial) == THIS->orig_serial &&
402 0 30 THI_CHECK_ITERATOR;
403 15 15 ST(0) = sv_mortalcopy(ix ? THIS->cur->val : THIS->cur->key);
436 0 14 if (items % 2 == 0)
449 14 14 for (cur = &ST(1); cur < end; cur += 2)
475 0 22 THI_CHECK_OBJECT;
0 22 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
22 0 THI_CHECK_OBJECT;
0 22 THI_CHECK_OBJECT;
479 133 22 for (cur = THIS->root->next; cur != THIS->root;)
523 0 164 THI_CHECK_OBJECT;
0 164 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
164 0 THI_CHECK_OBJECT;
0 164 THI_CHECK_OBJECT;
528 164 0 ST(0) = link == NULL ? &PL_sv_undef : sv_mortalcopy(link->val);
555 0 69 THI_CHECK_OBJECT;
0 69 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
69 0 THI_CHECK_OBJECT;
0 69 THI_CHECK_OBJECT;
559 10 59 bool has_rv = ix == 1 && GIMME_V != G_VOID;
10 0 bool has_rv = ix == 1 && GIMME_V != G_VOID;
3 7 bool has_rv = ix == 1 && GIMME_V != G_VOID;
0 0 bool has_rv = ix == 1 && GIMME_V != G_VOID;
561 3 66 if (has_rv)
568 3 66 if (has_rv)
591 0 34 THI_CHECK_OBJECT;
0 34 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
34 0 THI_CHECK_OBJECT;
0 34 THI_CHECK_OBJECT;
595 2 32 if (THIS->iter->key == NULL)
621 0 213 THI_CHECK_OBJECT;
0 213 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
213 0 THI_CHECK_OBJECT;
0 213 THI_CHECK_OBJECT;
625 32 181 if (THIS->iter->key == NULL)
655 0 14 THI_CHECK_OBJECT;
0 14 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
14 0 THI_CHECK_OBJECT;
0 14 THI_CHECK_OBJECT;
658 8 6 if (hv_exists_ent(THIS->hv, key, 0))
692 0 11 THI_CHECK_OBJECT;
0 11 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
11 0 THI_CHECK_OBJECT;
0 11 THI_CHECK_OBJECT;
695 4 7 if ((sv = hv_delete_ent(THIS->hv, key, 0, 0)) == NULL)
707 4 3 if (THIS->iter == cur)
741 0 14 THI_CHECK_OBJECT;
0 14 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
14 0 THI_CHECK_OBJECT;
0 14 THI_CHECK_OBJECT;
747 2 12 if (ix == 1 && GIMME_V != G_VOID)
2 0 if (ix == 1 && GIMME_V != G_VOID)
1 1 if (ix == 1 && GIMME_V != G_VOID)
768 0 5 THI_CHECK_OBJECT;
0 5 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
5 0 THI_CHECK_OBJECT;
0 5 THI_CHECK_OBJECT;
773 3 2 if (HvFILL(THIS->hv))
808 0 35 THI_CHECK_OBJECT;
0 35 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
35 0 THI_CHECK_OBJECT;
0 35 THI_CHECK_OBJECT;
810 8 27 num_keys = items > 1 ? (unsigned)(items - 1) : HvUSEDKEYS(THIS->hv);
0 27 num_keys = items > 1 ? (unsigned)(items - 1) : HvUSEDKEYS(THIS->hv);
811 14 21 num_items = (ix == 0 ? 2 : 1)*num_keys;
813 35 0 if (GIMME_V == G_SCALAR)
12 23 if (GIMME_V == G_SCALAR)
819 17 6 if (items == 1) /* "vanilla" version */
823 17 0 EXTEND(SP, num_items);
0 17 EXTEND(SP, num_items);
825 58 17 for (cur = THIS->root->next; cur != THIS->root; cur = cur->next, num_keys--)
827 54 4 if (ix != 2) PUSHs(sv_mortalcopy(cur->key));
828 35 23 if (ix != 1) PUSHs(sv_mortalcopy(cur->val));
840 6 0 EXTEND(SP, num_items);
0 6 EXTEND(SP, num_items);
846 0 6 Move(beg + 1, beg, items, SV *);
848 15 6 for (; key >= beg; --key)
850 9 6 if ((he = hv_fetch_ent(THIS->hv, *key, 0, 0)) != NULL)
852 6 3 if (ix != 1)
859 4 2 if (ix != 1)
864 10 5 if (ix != 2) *end-- = *key;
894 0 5 THI_CHECK_OBJECT;
0 5 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
5 0 THI_CHECK_OBJECT;
0 5 THI_CHECK_OBJECT;
896 0 5 if (items % 2 == 0)
910 1 4 if (mode == SM_UNSHIFT)
913 2 1 for (cur = &ST(items - 1); cur > end; cur -= 2)
921 11 4 for (cur = &ST(1); cur < end; cur += 2)
927 5 0 if (GIMME_V != G_VOID)
4 1 if (GIMME_V != G_VOID)
929 0 4 XSRETURN_IV(HvUSEDKEYS(THIS->hv));
953 0 6 THI_CHECK_OBJECT;
0 6 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
6 0 THI_CHECK_OBJECT;
0 6 THI_CHECK_OBJECT;
957 1 5 if (root->next == root)
964 2 3 goner = ix == 0 ? root->prev : root->next;
969 5 0 if (GIMME_V == G_ARRAY)
2 3 if (GIMME_V == G_ARRAY)
971 0 2 XPUSHs(sv_2mortal(goner->key));
978 0 5 XPUSHs(sv_2mortal(goner->val));
1004 3 1 it->cur = ix == 1 ? THIS->root->prev : THIS->root->next;
1044 4 4 if (ix >= 2 && GIMME_V != G_VOID)
4 0 if (ix >= 2 && GIMME_V != G_VOID)
4 0 if (ix >= 2 && GIMME_V != G_VOID)
1060 0 8 SvSETMAGIC(link->val);
1062 8 0 if (GIMME_V == G_VOID)
0 8 if (GIMME_V == G_VOID)
1067 4 4 ST(0) = orig ? orig : sv_mortalcopy(link->val);
1139 0 13 PUSHMARK(SP);
1141 11 2 if (myop.op_type == OP_OR || myop.op_type == MY_OP_DOR)
4 7 if (myop.op_type == OP_OR || myop.op_type == MY_OP_DOR)
1143 0 6 XPUSHs(val);
1144 0 6 XPUSHs(link->val);
1148 0 7 XPUSHs(link->val);
1149 0 7 XPUSHs(val);
1163 11 2 if (myop.op_type == OP_OR || myop.op_type == MY_OP_DOR)
4 7 if (myop.op_type == OP_OR || myop.op_type == MY_OP_DOR)
1167 0 6 SvSETMAGIC(link->val);
1171 1 12 FREETMPS;
1175 13 0 if (GIMME_V != G_VOID)
12 1 if (GIMME_V != G_VOID)
1203 0 8 THI_CHECK_OBJECT;
0 8 THI_CHECK_OBJECT;
0 0 THI_CHECK_OBJECT;
8 0 THI_CHECK_OBJECT;
0 8 THI_CHECK_OBJECT;
1209 0 8 XPUSHs(sv_2mortal(newSVpvn((char *)&s, sizeof(Serialized))));
1210 0 8 num_keys = HvUSEDKEYS(THIS->hv);
1211 8 0 EXTEND(SP, 2*num_keys);
0 8 EXTEND(SP, 2*num_keys);
1212 72 8 for (cur = THIS->root->next; cur != THIS->root; cur = cur->next, num_keys--)
1244 8 0 if (!sv_isobject(object) || SvTYPE(SvRV(object)) != SVt_PVMG)
0 8 if (!sv_isobject(object) || SvTYPE(SvRV(object)) != SVt_PVMG)
1248 8 0 ps = (Serialized *) SvPV(serialized, len);
1250 8 0 if (len < sizeof(SerialRev) ||
0 8 if (len < sizeof(SerialRev) ||
1255 0 8 if (ps->rev.major != THI_SERIAL_REV_MAJOR)
1270 0 8 if ((items-3) % 2)
1273 72 8 for (i = 3; i < items; i+=2)
1289 0 72 if (hv_store_ent(THIS->hv, key, val, 0) == NULL)