xs/test.xs

filter: Statementstmt 90.0% 18 / 20 Branchbran 62.5% 15 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 75.0% 33 / 44 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xs/abi.xs ↑ Summary include/store/store_txn.h »
1 # Doors for the tests. Nothing here is part of the interface.
2  
3 MODULE = State::Store PACKAGE = State::Store
4  
5 # The version of the table this library resolved when it loaded.
6 IV
7 _hamt_abi_version()
8 CODE:
9 1 ▶ RETVAL = STORE_HAMT ? STORE_HAMT->abi_version : 0;
Branch: 2 branches
BranchTrueFalseTotal
RETVAL = STORE_HAMT ? STORE_HAMT->abi_version : 0; 1 0 1
RETVAL = STORE_HAMT ? STORE_HAMT->abi_version : 0; 0 1 1
10 OUTPUT:
11 RETVAL
12  
13 # The version of the header it was compiled against.
14 IV
15 _hamt_abi_built()
16 CODE:
17 1 ▶ RETVAL = HAMT_ABI_VERSION;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = HAMT_ABI_VERSION; 0 1 1
18 OUTPUT:
19 RETVAL
20  
21 # A vector made, filled, read and given up through the table: how many it
22 # held, its last value, and whether HAMT called it well formed. Proof that
23 # the table resolved is one that can be called.
24 void
25 _hamt_roundtrip(...)
26 PREINIT:
27 hamt_vec *v;
28 I32 i;
29 size_t n;
30 SV *last;
31 int bad;
32 PPCODE:
33 6 v = (STORE_HAMT->vec_new)(aTHX);
34 6 ▶ if (!v) croak("State::Store::_hamt_roundtrip: out of memory");
Branch: 1 branch
BranchTrueFalseTotal
if (!v) croak("State::Store::_hamt_roundtrip: out of memory"); 0 6 6
35 15108 ▶ for (i = 0; i < items; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < items; i++) { 15102 6 15108
36 15102 ▶ if ((STORE_HAMT->vec_push)(aTHX_ v, ST(i)) != HAMT_ABI_OK) {
Branch: 1 branch
BranchTrueFalseTotal
if ((STORE_HAMT->vec_push)(aTHX_ v, ST(i)) != HAMT_ABI_OK) { 0 15102 15102
37 0 (STORE_HAMT->vec_release)(aTHX_ v);
38 0 croak("State::Store::_hamt_roundtrip: out of memory");
39 }
40 }
41 6 n = (STORE_HAMT->vec_count)(aTHX_ v);
42 6 ▶ last = n ? (STORE_HAMT->vec_fetch)(aTHX_ v, n - 1) : NULL;
Branch: 1 branch
BranchTrueFalseTotal
last = n ? (STORE_HAMT->vec_fetch)(aTHX_ v, n - 1) : NULL; 5 1 6
43 6 ▶ last = last ? newSVsv(last) : newSV(0);
Branch: 1 branch
BranchTrueFalseTotal
last = last ? newSVsv(last) : newSV(0); 5 1 6
44 6 bad = (STORE_HAMT->vec_check)(aTHX_ v);
45 6 (STORE_HAMT->vec_release)(aTHX_ v);
46 6 ▶ EXTEND(SP, 3);
Branch: 1 branch
BranchTrueFalseTotal
EXTEND(SP, 3); 0 6 6
47 6 PUSHs(sv_2mortal(newSVuv((UV)n)));
48 6 PUSHs(sv_2mortal(last));
49 6 PUSHs(sv_2mortal(newSViv(bad)));
50  
51 # How many blocks this library holds for itself.
52 IV
53 _live_blocks()
54 CODE:
55 22 ▶ RETVAL = (IV)store_live_blocks;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (IV)store_live_blocks; 0 22 22
56 OUTPUT:
57 RETVAL
58  
59 # perl's temporaries stack, for a test that says a loop of calls leaves
60 # nothing on it.
61 IV
62 _tmps_ix()
63 CODE:
64 10 ▶ RETVAL = (IV)PL_tmps_ix;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (IV)PL_tmps_ix; 0 10 10
65 OUTPUT:
66 RETVAL
67  
68 # Places in the watcher list, removed ones not yet swept out included.
69 IV
70 _watcher_slots(self)
71 SV *self
72 CODE:
73 3 ▶ RETVAL = (IV)store_handle(aTHX_ self, "State::Store::_watcher_slots")->nwatchers;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = (IV)store_handle(aTHX_ self, "State::Store::_watcher_slots")->nwatchers; 0 3 3
74 OUTPUT:
75 RETVAL
« xs/abi.xs ↑ Summary include/store/store_txn.h »