Branch Coverage

blib/lib/VIC/PIC/Functions/Operators.pm
Criterion Covered Total %
branch 166 374 44.3


line true false branch
13 0 36 unless $self->doesrole('Chip')
14 0 36 if (ref $var eq 'HASH' and $var->{'type'} eq 'string')
24 2 34 if ($val >= {sign => '+', value => [2]} ** $bits)
30 8 28 if ($val == {sign => '+', value => [0]}) { }
38 28 0 if $valbyte > {sign => '+', value => [0]}
39 0 28 if $valbyte == {sign => '+', value => [0]}
46 0 0 if $valbyte > {sign => '+', value => [0]}
47 0 0 if $valbyte == {sign => '+', value => [0]}
140 0 52 unless $self->doesrole('Operators')
142 36 16 if $var2 =~ /$literal/
144 2 14 if (ref $var1 eq 'HASH')
145 2 0 if ($var1->{'type'} eq 'string')
146 2 0 if (ref $var2 eq 'HASH' and exists $var2->{'string'}) { }
156 1 1 if (not $var2->{'empty'}) { }
164 2 0 wantarray ? :
177 14 0 if ($b1 == $b2) { }
0 0 elsif ($b1 > $b2) { }
0 0 elsif ($b1 < $b2) { }
208 0 14 if $extra{'RESULT'}
214 0 80 unless $self->doesrole('Operators')
215 0 80 unless $var
222 0 2 unless $self->doesroles('Operators', 'Chip')
223 0 2 unless (exists $self->registers->{'STATUS'})
243 0 4 unless $self->doesroles('Operators', 'Chip')
244 0 4 unless (exists $self->registers->{'STATUS'})
264 0 4 unless $self->doesroles('Operators', 'Chip')
265 0 4 unless (exists $self->registers->{'STATUS'})
271 4 0 if (not $var =~ /$literal/ and $bits =~ /$literal/) { }
0 0 elsif ($var =~ /$literal/ and $bits =~ /$literal/) { }
274 4 0 if ($bits == {sign => '+', value => [1]}) { }
0 0 elsif ($bits == {sign => '+', value => [0]}) { }
295 2 2 if $extra{'RESULT'}
301 0 7 unless $self->doesroles('Operators', 'Chip')
302 0 7 unless (exists $self->registers->{'STATUS'})
308 7 0 if (not $var =~ /$literal/ and $bits =~ /$literal/) { }
0 0 elsif ($var =~ /$literal/ and $bits =~ /$literal/) { }
311 7 0 if ($bits == {sign => '+', value => [1]}) { }
0 0 elsif ($bits == {sign => '+', value => [0]}) { }
332 2 5 if $extra{'RESULT'}
338 0 0 unless $self->doesroles('Operators', 'Chip')
339 0 0 unless (exists $self->registers->{'STATUS'})
357 0 0 unless $self->doesroles('Operators', 'Chip')
358 0 0 unless (exists $self->registers->{'STATUS'})
377 0 7 unless $self->doesroles('Operators', 'Chip')
378 0 7 unless (exists $self->registers->{'STATUS'})
383 7 0 if (@_)
385 7 0 if $extra{'RESULT'}
408 0 0 if (@_)
410 0 0 if $extra{'RESULT'}
422 0 2 unless $self->doesroles('Operators', 'Chip')
423 0 2 unless (exists $self->registers->{'STATUS'})
431 0 2 if $val == {sign => '+', value => [0]}
433 2 0 if $val < {sign => '+', value => [256]}
434 0 2 if $val < {sign => '+', value => [65536]} and $val >= {sign => '+', value => [256]}
435 0 2 if $val < {sign => '+', value => [294967296, 4]} and $val >= {sign => '+', value => [65536]}
436 0 2 if $val < {sign => '+', value => [709551616, 446744073, 18]} and $val >= {sign => '+', value => [294967296, 4]}
437 0 2 if ($b1 > $b2) { }
0 2 elsif ($b1 < $b2) { }
444 2 0 if $valbyte > {sign => '+', value => [0]}
445 0 2 if $valbyte == {sign => '+', value => [0]}
454 0 0 if $valbyte > {sign => '+', value => [0]}
457 0 2 if $extra{'RESULT'}
465 2 0 if $var2 =~ /$literal/
469 0 0 if $extra{'RESULT'}
483 2 0 wantarray ? :
490 2 0 wantarray ? :
497 2 0 wantarray ? :
504 2 0 wantarray ? :
511 2 0 wantarray ? :
518 3 0 wantarray ? :
525 2 0 wantarray ? :
532 2 0 wantarray ? :
539 5 0 wantarray ? :
544 0 6 unless $self->doesroles('Operators', 'Chip')
545 0 6 unless (exists $self->registers->{'STATUS'})
567 0 2 unless $self->doesroles('Operators', 'Chip')
568 0 2 unless (exists $self->registers->{'STATUS'})
574 0 2 if $b1 > {sign => '+', value => [1]}
590 0 16 unless $self->doesrole('Chip')
595 12 4 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
0 4 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
4 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
638 16 0 if $extra{'RESULT'}
644 0 8 unless $self->doesrole('Chip')
649 8 0 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
0 0 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
0 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
692 6 2 if $extra{'RESULT'}
766 8 4 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
0 4 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
4 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
810 10 2 if $extra{'RESULT'}
811 12 0 wantarray ? :
930 6 2 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
0 2 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
2 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
974 6 2 if $extra{'RESULT'}
975 8 0 wantarray ? :
984 6 0 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
0 0 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
0 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
1028 4 2 if $extra{'RESULT'}
1029 6 0 wantarray ? :
1036 0 2 if $extra{'RESULT'}
1037 0 2 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
2 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
0 0 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
1079 0 3 if $extra{'RESULT'}
1080 0 3 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
3 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
0 0 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
1122 0 2 if $extra{'RESULT'}
1123 0 2 if (not $var1 =~ /$literal/ || $var2 =~ /$literal/) { }
2 0 elsif (not $var1 =~ /$literal/ and $var2 =~ /$literal/) { }
0 0 elsif ($var1 =~ /$literal/ and not $var2 =~ /$literal/) { }
1166 11 3 if (not defined $extra{'RESULT'}) { }
1167 2 9 $extra{'SWAP'} ? :
1168 2 9 $extra{'SWAP'} ? :
1180 2 1 $extra{'SWAP'} ? :
1182 2 1 $extra{'SWAP'} ? :
1201 2 12 wantarray ? :
1206 0 0 if (defined $extra{'RESULT'}) { }
1210 0 0 if ($res) { }
1211 0 0 $extra{'SWAP'} ? :
1213 0 0 $extra{'SWAP'} ? :
1219 0 0 if ($res) { }
1220 0 0 $extra{'SWAP'} ? :
1222 0 0 $extra{'SWAP'} ? :
1230 0 10 unless $self->doesroles('Operators', 'Chip')
1231 0 10 unless (exists $self->registers->{'STATUS'})
1235 4 6 $extra{'SWAP'} ? :
1238 0 10 if (not $lhs =~ /$literal/ || $rhs =~ /$literal/) { }
0 10 elsif (not $rhs =~ /$literal/ and $lhs =~ /$literal/) { }
10 0 elsif ($rhs =~ /$literal/ and not $lhs =~ /$literal/) { }
1273 0 0 $lhs == $rhs ? :
1280 0 1 unless $self->doesroles('Operators', 'Chip')
1281 0 1 unless (exists $self->registers->{'STATUS'})
1287 0 1 if (not $lhs =~ /$literal/ || $rhs =~ /$literal/) { }
1 0 elsif (not $rhs =~ /$literal/ and $lhs =~ /$literal/) { }
0 0 elsif ($rhs =~ /$literal/ and not $lhs =~ /$literal/) { }
1325 0 0 $lhs < $rhs ? :
1332 0 1 unless $self->doesroles('Operators', 'Chip')
1333 0 1 unless (exists $self->registers->{'STATUS'})
1339 0 1 if (not $lhs =~ /$literal/ || $rhs =~ /$literal/) { }
1 0 elsif (not $rhs =~ /$literal/ and $lhs =~ /$literal/) { }
0 0 elsif ($rhs =~ /$literal/ and not $lhs =~ /$literal/) { }
1377 0 0 $lhs >= $rhs ? :
1401 0 1 unless $self->doesroles('Operators', 'Chip')
1402 0 1 unless (exists $self->registers->{'STATUS'})
1408 1 0 if (not $lhs =~ /$literal/ || $rhs =~ /$literal/) { }
0 0 elsif (not $rhs =~ /$literal/ and $lhs =~ /$literal/) { }
0 0 elsif ($rhs =~ /$literal/ and not $lhs =~ /$literal/) { }
1454 0 0 $lhs && $rhs ? :
1461 0 1 unless $self->doesroles('Operators', 'Chip')
1462 0 1 unless (exists $self->registers->{'STATUS'})
1468 1 0 if (not $lhs =~ /$literal/ || $rhs =~ /$literal/) { }
0 0 elsif (not $rhs =~ /$literal/ and $lhs =~ /$literal/) { }
0 0 elsif ($rhs =~ /$literal/ and not $lhs =~ /$literal/) { }
1514 0 0 $lhs || $rhs ? :
1600 2 0 if (not $var1 =~ /$literal/) { }
0 0 elsif ($var1 =~ /$literal/) { }
1623 2 0 if $extra{'RESULT'}
1624 2 0 wantarray ? :
1633 2 0 if ref $str eq 'HASH'
1635 2 0 if ref $str eq 'HASH'
1637 1 1 if ($str->{'empty'}) { }
1659 2 0 wantarray ? :
1666 0 0 if scalar @$arr
1667 0 0 unless $arrstr
1678 0 1 unless $self->doesrole('Chip')
1679 0 1 unless (exists $self->registers->{'PCL'})
1685 1 0 if (scalar @$table) { }
1696 1 0 wantarray ? :
1701 0 1 unless defined $extra{'RESULT'}
1704 1 0 if $sz
1707 1 0 if $sz
1728 0 31 unless defined $tables
1729 0 31 unless $self->doesrole('Chip')
1731 0 31 unless (ref $tables eq 'ARRAY')
1734 28 3 unless scalar @$tables
1738 0 5 unless defined $name
1739 0 5 unless exists $_->{'bytes'}
1740 0 5 unless ref $_->{'bytes'} eq 'ARRAY'
1742 5 0 if defined $_->{'comment'}
1795 1 0 if (ref $dvar eq 'HASH' and $dvar->{'type'} eq 'string') { }
1806 1 0 wantarray ? :
1812 0 1 if (ref $var2 eq 'HASH') { }