Branch Coverage

XS.xs
Criterion Covered Total %
branch 81 140 57.8


line true false branch
66 26 6 while (cur_index >= 1) {
69 26 0 ap = av_fetch(av, cur_index, 0);
70 26 0 bp = av_fetch(av, rand_index, 0);
71 26 0 a = (ap ? sv_2mortal( newSVsv(*ap) ) : &PL_sv_undef);
26 0 a = (ap ? sv_2mortal( newSVsv(*ap) ) : &PL_sv_undef);
26 0 a = (ap ? sv_2mortal( newSVsv(*ap) ) : &PL_sv_undef);
72 26 0 b = (bp ? sv_2mortal( newSVsv(*bp) ) : &PL_sv_undef);
26 0 b = (bp ? sv_2mortal( newSVsv(*bp) ) : &PL_sv_undef);
26 0 b = (bp ? sv_2mortal( newSVsv(*bp) ) : &PL_sv_undef);
73 26 0 SvREFCNT_inc_simple_void(a);
74 26 0 SvREFCNT_inc_simple_void(b);
77 26 0 if (av_store(av, cur_index, b) == NULL)
26 0 if (av_store(av, cur_index, b) == NULL)
78 26 0 SvREFCNT_dec(b);
79 26 0 mg_set(b);
81 26 0 if (av_store(av, rand_index, a) == NULL)
26 0 if (av_store(av, rand_index, a) == NULL)
82 26 0 SvREFCNT_dec(a);
83 26 0 mg_set(a);
97 4 1 while (cur_index <= num) {
98 4 0 rand_index = cur_index + (len - cur_index) * Drand01(); // cur_index + rand() % (len - cur_index)
102 4 0 ap = av_fetch(av, cur_index, 0);
103 4 0 bp = av_fetch(av, rand_index, 0);
104 4 0 a = (ap ? sv_2mortal( newSVsv(*ap) ) : &PL_sv_undef);
4 0 a = (ap ? sv_2mortal( newSVsv(*ap) ) : &PL_sv_undef);
4 0 a = (ap ? sv_2mortal( newSVsv(*ap) ) : &PL_sv_undef);
105 4 0 b = (bp ? sv_2mortal( newSVsv(*bp) ) : &PL_sv_undef);
4 0 b = (bp ? sv_2mortal( newSVsv(*bp) ) : &PL_sv_undef);
4 0 b = (bp ? sv_2mortal( newSVsv(*bp) ) : &PL_sv_undef);
106 4 0 SvREFCNT_inc_simple_void(b);
107 4 0 SvREFCNT_inc_simple_void(a);
112 4 0 if (av_store(av, cur_index, b) == NULL)
4 0 if (av_store(av, cur_index, b) == NULL)
113 4 0 SvREFCNT_dec(b);
114 4 0 mg_set(b);
116 4 0 if (av_store(av, rand_index, a) == NULL)
4 0 if (av_store(av, rand_index, a) == NULL)
117 4 0 SvREFCNT_dec(a);
118 4 0 mg_set(a);
128 6 1000015 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
6 0 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
6 1000015 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
137 10000117 1000015 while (cur_index >= 0) {
138 10000117 0 rand_index = (cur_index + 1) * Drand01(); // rand() % (cur_index + 1);
154 1 1 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
1 0 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
1 1 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
163 3 1 while (cur_index <= num) {
164 3 0 rand_index = cur_index + (len - cur_index) * Drand01(); // cur_index + rand() % (len - cur_index);
191 0 2 if (num < 0)
194 2 0 if (num != 0) {
201 2 0 if (num < last_index) {
208 1 1 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
1 0 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
1 1 if (SvTIED_mg((SV *)av, PERL_MAGIC_tied)) {
212 4 1 for (k = 0; k <= num; k++) {
214 4 0 sv = (svp ? newSVsv(*svp) : &PL_sv_undef);
219 1 0 else if (GIMME_V == G_VOID) {
0 1 else if (GIMME_V == G_VOID) {
250 0 3 if (items == 0)
253 12 3 for (i = 0; i < items; i++) {
255 3 9 if (!SvOK(sv)) // skip undefs
3 0 if (!SvOK(sv)) // skip undefs
3 0 if (!SvOK(sv)) // skip undefs
257 0 9 if (!SvROK(sv)) // isn't a ref type
258 0 0 croak_sv_is_not_an_arrayref(i);
260 9 0 if (SvTYPE(ref) == SVt_PVAV) { // $ref eq "ARRAY"
262 9 0 len = av_len(av);
263 9 0 shuffle_av_last_num_elements(av, len, len);
266 0 0 croak_sv_is_not_an_arrayref(i);