Branch Coverage

blib/lib/VIC/Receiver.pm
Criterion Covered Total %
branch 480 714 67.2


line true false branch
57 0 33 if defined $self->pic_override
61 0 33 unless (defined $self->pic and defined $self->pic->type)
82 20 0 if scalar @$list
83 2 18 if ($sim eq 'simulator' and not $stype =~ /disable/i) { }
1 34 elsif ($sim eq 'simulator' and $stype =~ /disable/i) { }
86 2 0 if ($self->simulator) { }
87 0 2 unless ($self->simulator->type eq $stype)
95 1 0 if $self->simulator
102 94 0 if $anon_block =~ /_anonblock(\d+)/
103 0 94 unless defined $id
105 32 62 if ($name eq 'Main') { }
16 46 elsif ($name =~ /^Loop/) { }
6 40 elsif ($name =~ /^Action/) { }
12 28 elsif ($name =~ /^True/) { }
4 24 elsif ($name =~ /^False/) { }
5 19 elsif ($name =~ /^ISR/) { }
19 0 elsif ($name eq 'Simulator') { }
124 43 51 if $name =~ /^(?:Loop|Action|True|False|ISR)/
141 94 0 if (defined $stack and ref $stack eq 'ARRAY')
145 94 0 if $label ne $expected_label
146 94 0 if $label
153 43 51 if (defined $parent)
154 43 0 unless ($parent =~ /BLOCK::/)
156 43 0 if (exists $self->ast->{$parent} and ref $self->ast->{$parent} eq 'ARRAY' and $parent ne $anon_block)
160 43 0 if $plabel
164 16 27 if ($block_label =~ /True|False/i)
169 11 32 if length $expected_param
180 16 78 if $block_label =~ /Loop/i
187 78 0 if ref $list eq 'ARRAY'
221 779 0 if (ref $list eq 'ARRAY') { }
232 381 0 if $block
239 246 0 if $list
242 107 139 if ($self->simulator and $self->simulator->can($method)) { }
246 1 138 unless ($self->pic->can($method))
254 11 344 if ($a =~ /BLOCK::(\w+)::(Action|ISR)\w+::.*::(_end_\w+)::(\w+)$/) { }
285 0 85 ref $rhsx eq 'ARRAY' ? :
286 5 80 if ($rhs =~ /PARAM::(\w+)/) { }
302 0 1 if (ref $rhsx eq 'ARRAY')
309 1 0 if (exists $vref->{'type'} and $vref->{'type'} eq 'HASH') { }
0 0 elsif (exists $vref->{'type'} and $vref->{'type'} eq 'ARRAY') { }
0 0 elsif (exists $vref->{'type'} and $vref->{'type'} eq 'string') { }
324 1 0 if ($varname)
328 0 0 unless $varname
344 3 0 if (scalar @$list == {sign => '+', value => [1]}) { }
350 3 0 if (ref $rhs eq 'HASH' or ref $rhs eq 'ARRAY') { }
351 0 3 unless (exists $self->ast->{'variables'}{$lhs})
354 1 2 if (exists $rhs->{'TABLE'} or ref $rhs eq 'ARRAY') { }
2 0 elsif (exists $rhs->{'string'}) { }
355 1 0 if ref $rhs eq 'HASH' and exists $rhs->{'TABLE'}
356 1 0 if ref $rhs eq 'HASH' and exists $rhs->{'TABLE'}
357 0 1 if ref $rhs eq 'ARRAY'
361 1 0 if ($szpref)
377 0 0 if ($rhs =~ /^-?\d+$/) { }
397 0 12 unless scalar @$predicate
398 4 8 $type eq 'while' ? :
401 3 9 if $parent =~ /^conditional/
402 0 12 if (ref $predicate ne 'ARRAY')
406 12 0 if (scalar @$predicate < {sign => '+', value => [3]}) { }
409 12 0 if $tb
410 12 0 if $fb
411 12 0 if $tb and scalar @$tb
412 12 0 if $true_block
413 4 8 if $fb and scalar @$fb
414 4 8 if $false_block
419 12 0 if (scalar @condblocks < {sign => '+', value => [3]}) { }
423 4 12 if $p =~ /BLOCK::(\w+)::(False\d+)::/
424 12 4 if $p =~ /BLOCK::(\w+)::(True\d+)::/
425 16 0 if $p =~ /BLOCK::.*::(_end_conditional\w+)$/
427 8 4 unless defined $false_label
428 0 12 unless defined $true_label
430 0 12 if ref $subject eq 'ARRAY'
440 12 0 if ($true_name and exists $mapping->{$true_name})
445 4 0 if ($false_name and exists $mapping->{$false_name})
454 9 3 unless $subcond
465 16 0 if (ref $list eq 'ARRAY') { }
467 4 12 if (scalar @$list == {sign => '+', value => [1]}) { }
0 12 elsif (scalar @$list == {sign => '+', value => [2]}) { }
11 1 elsif (scalar @$list == {sign => '+', value => [3]}) { }
469 1 3 if $var1 =~ /^\d+$/
515 296 0 if (ref $list eq 'ARRAY') { }
517 236 60 if (scalar @$list == {sign => '+', value => [1]}) { }
8 52 elsif (scalar @$list == {sign => '+', value => [2]}) { }
46 6 elsif (scalar @$list == {sign => '+', value => [3]}) { }
6 0 elsif (scalar @$list > {sign => '+', value => [3]}) { }
519 2 234 if ($val =~ /MOP::/) { }
582 16 26 if $op eq '+'
583 6 20 if $op eq '-'
584 10 10 if $op eq '*'
585 6 4 if $op eq '/'
586 4 0 if $op eq '%'
592 2 2 if $op eq '<<'
593 2 0 if $op eq '>>'
599 0 0 if $op eq '^'
600 0 0 if $op eq '|'
601 0 0 if $op eq '&'
607 1 1 if $op eq '&&'
608 1 0 if $op eq '||'
614 1 36 if $op eq '<='
615 0 36 if $op eq '<'
616 0 36 if $op eq '>='
617 1 35 if $op eq '>'
618 31 4 if $op eq '=='
619 4 0 if $op eq '!='
625 8 0 if $op eq '!'
626 0 0 if $op eq '~'
632 0 88 if (ref $op eq 'ARRAY')
636 63 25 if $op eq '='
637 2 23 if $op eq '+='
638 2 21 if $op eq '-='
639 2 19 if $op eq '*='
640 2 17 if $op eq '/='
641 2 15 if $op eq '%='
642 2 13 if $op eq '^='
643 2 11 if $op eq '|='
644 3 8 if $op eq '&='
645 2 6 if $op eq '<<='
646 5 1 if $op eq '>>='
647 1 0 if $op eq '.='
653 6 2 if $op eq '++'
654 2 0 if $op eq '--'
660 10 0 if ref $arr eq 'ARRAY'
672 0 12 if $method and ref $value eq 'ARRAY'
673 0 12 if $method
675 11 1 if ($self->simulator and $self->simulator->supports_modifier($modifier))
682 1 0 if ($modifier eq 'TABLE') { }
0 0 elsif ($modifier eq 'ARRAY') { }
0 0 elsif ($modifier eq 'STRING') { }
683 1 0 if ref $value eq 'ARRAY'
686 0 0 if ref $value eq 'ARRAY'
689 0 0 if ref $value eq 'ARRAY'
692 0 0 unless $method
698 2 0 if ref $list eq 'ARRAY'
703 0 2 unless $method
710 207 0 if (ref $list eq 'ARRAY') { }
714 207 0 if defined $suffix
718 207 0 if $self->pic->validate($varname)
724 419 0 if ref $list eq 'ARRAY'
731 0 419 if $parent eq 'pragmas'
738 42 377 unless exists $self->ast->{'variables'}{$varname}
739 26 393 if $parent =~ /assert_/
746 0 11 if (ref $list eq 'ARRAY') { }
752 0 11 unless defined $b
753 6 5 if $b =~ /TRUE|true/i
754 0 5 if $b == {sign => '+', value => [1]}
755 5 0 if $b =~ /FALSE|false/i
786 1 616 if $h->{'string'} eq $str
788 1 46 if $str eq ''
806 56 344 if $list =~ /0x|0X/
808 344 0 if $val >= {sign => '+', value => [0]}
821 0 51 unless defined $units
822 2 49 if $units eq 'us'
823 13 38 if $units eq 'ms'
824 19 32 if $units eq 's'
825 6 45 if $units eq 'Hz'
826 5 46 if $units eq 'kHz'
827 0 51 if $units eq 'MHz'
834 0 5 if $list =~ /\d+\.$/
835 0 5 if $list =~ /^\.(\d+)$/
836 0 5 if $list =~ /^-\.(\d+)$/
845 66 0 if (ref $funcs eq 'HASH')
850 66 0 if (ref $macros eq 'HASH')
851 0 66 unless ref $macros eq 'HASH'
861 0 18 if (ref $tables eq 'HASH')
864 0 18 unless (ref $tables eq 'ARRAY')
869 0 5 unless defined $s->{'bytes'}
870 0 5 unless defined $s->{'name'}
879 0 28 unless $self->simulator
880 28 0 if ref $list eq 'ARRAY'
881 0 28 if (scalar @$list < {sign => '+', value => [3]})
889 28 0 if ref $list eq 'ARRAY'
891 1 27 unless defined $msg
903 0 130 if $self->intermediate_inline
905 138 50 unless /HASH|ARRAY/
906 0 50 unless exists $self->global_collections->{$_}
909 1 129 if $self->simulator->disable
911 0 129 unless $code
912 129 0 if $code
923 6 263 if (exists $self->global_collections->{$_})
927 29 234 if (exists $self->ast->{'variables'}{$_})
929 1 28 if ($vhref->{'type'} eq 'string')
940 1 135 unless $code
941 0 135 if $self->intermediate_inline
942 135 0 if $code
943 35 100 if $funcs or $macros
944 16 119 if $tables
954 0 8 unless $self->pic->can($method)
956 8 0 if (exists $ast->{'variables'}{$varname}) { }
959 0 8 unless $code
960 0 8 if $self->intermediate_inline
961 8 0 if $code
962 0 8 if $funcs or $macros
963 0 8 if $tables
975 9 61 if (scalar @args == {sign => '+', value => [2]}) { }
60 1 elsif (scalar @args == {sign => '+', value => [3]}) { }
1 0 elsif (scalar @args == {sign => '+', value => [4]}) { }
991 36 34 if (exists $extra{'STACK'})
992 36 0 if (defined $var1)
995 35 1 if (defined $var2)
999 68 2 if $tag eq 'OP'
1000 2 68 if $tag eq 'MOP'
1001 0 70 unless $method and $self->pic->can($method)
1003 0 70 if $self->intermediate_inline
1005 0 70 unless $code
1006 70 0 if $code
1007 22 48 if $funcs or $macros
1008 0 70 if $tables
1016 2 68 unless $tag eq 'OP'
1019 7 61 if ($sz == {sign => '+', value => [2]}) { }
61 0 elsif ($sz == {sign => '+', value => [3]} or $sz == {sign => '+', value => [4]}) { }
1021 0 7 if (exists $self->ast->{'tmp_variables'}{$var})
1024 0 0 if @rdeps
1028 15 46 if (exists $self->ast->{'tmp_variables'}{$var1})
1031 7 8 if @rdeps
1033 13 48 if (exists $self->ast->{'tmp_variables'}{$var2})
1036 6 7 if @rdeps
1041 68 0 wantarray ? :
1048 2 40 unless $tag eq 'OP'
1051 6 34 if ($sz == {sign => '+', value => [2]}) { }
34 0 elsif ($sz == {sign => '+', value => [3]} or $sz == {sign => '+', value => [4]}) { }
1053 6 0 if (exists $self->ast->{'variables'}{$var})
1058 27 7 if (exists $self->ast->{'variables'}{$var1})
1061 12 22 if (exists $self->ast->{'variables'}{$var2})
1067 40 0 wantarray ? :
1072 2 32 unless @deps
1074 32 0 if &max(@bits) == $self->pic->wreg_size
1083 0 88 if $self->intermediate_inline
1084 88 0 if (exists $ast->{'variables'}{$varname}) { }
1085 31 57 if (exists $ast->{'tmp_variables'}{$rhs}) { }
1089 6 25 if @deps
1090 0 31 if ($self->intermediate_inline)
1091 0 0 if @deps
1092 0 0 if @vdeps
1099 6 25 if (scalar @deps) { }
1109 6 24 if $_ eq $rhs
1110 30 0 if $tcode
1112 0 30 if $self->intermediate_inline
1113 30 0 if @newcode
1117 25 0 unless scalar @deps
1118 25 0 if (not $use_stack) { }
1121 25 0 if @newcode
1129 2 55 if ($rhs =~ /HASH|ARRAY/)
1130 2 0 if (exists $self->global_collections->{$rhs})
1134 57 0 if (exists $self->ast->{'variables'}{$varname})
1136 3 54 if ($vhref->{'type'} eq 'string')
1146 0 57 unless $self->pic->can($method)
1148 0 57 unless $code
1149 0 57 if $self->intermediate_inline
1150 57 0 if $code
1151 9 48 if $funcs or $macros
1152 2 55 if $tables
1163 0 7 unless exists $mapping->{$child}
1164 7 0 if (exists $mapping->{$child}{'loop'})
1165 4 3 if $mapping->{$child}{'loop'} eq '1'
1167 0 3 unless $mapping->{$child}{'parent'}
1178 0 43 if $child eq $block or $child eq $mapped_block or $child eq $parent
1179 0 43 if exists $ast->{'generated_blocks'}{$child}
1180 0 43 if $self->intermediate_inline
1184 16 27 if ($child =~ /^(?:True|False)/ and @newcode) { }
11 16 elsif ($child =~ /^(?:Action|ISR)/ and @newcode) { }
16 0 elsif ($child =~ /^Loop/ and @newcode) { }
1187 2 14 if (@bindexes)
1190 2 0 if $el
1192 0 2 if (not $el) { }
1201 2 14 if (@cindexes)
1204 2 0 if $sl
1205 2 0 if $sl
1206 0 2 unless $sl
1211 4 12 if (exists $mapping->{$child}{'loop'} and $mapping->{$child}{'loop'} eq '1') { }
1213 4 0 if $slabel
1214 0 4 unless $start_code
1224 0 11 if (@bindexes)
1230 0 11 if (@cindexes)
1240 0 16 if (@bindexes)
1246 0 16 if (@cindexes)
1255 0 0 if @newcode
1257 43 0 if @newcode
1262 0 43 if (defined $parent and exists $ast->{$parent} and ref $ast->{$parent} eq 'ARRAY' and $parent ne $mapped_block)
1265 0 0 if $plabel
1278 0 12 if $self->intermediate_inline
1281 3 9 if $hh{'SUBCOND'}
1284 9 3 unless defined $start_label
1285 9 3 unless defined $is_loop
1286 9 3 unless defined $end_label
1288 4 8 if ($blockcount > {sign => '+', value => [1]})
1290 3 1 if $hh{'FALSE'} eq $hh{'END'}
1291 0 4 if $hh{'TRUE'} eq $hh{'END'}
1294 1 11 if ($subj =~ /^\d+?$/) { }
0 11 elsif (exists $ast->{'variables'}{$subj}) { }
11 0 elsif (exists $ast->{'tmp_variables'}{$subj}) { }
1295 0 1 if $self->intermediate_inline
1296 0 1 if ($subj eq {sign => '+', value => [0]}) { }
1298 0 0 if $hh{'FALSE'}
1301 1 0 if $hh{'TRUE'}
1303 1 0 if $hh{'END'}
1304 1 0 if $hh{'END'}
1313 2 9 if @deps
1314 0 11 if ($self->intermediate_inline)
1315 0 0 if @deps
1316 0 0 if @vdeps
1319 2 9 if (scalar @deps) { }
1330 4 2 if $_ ne $subj
1331 6 0 if $tcode
1333 6 0 if @newcode
1338 9 0 if (not $use_stack) { }
1340 9 0 if @newcode
1341 0 9 unless @newcode
1352 9 0 if defined $start_label
1353 1 8 if defined $end_label and $blockcount > {sign => '+', value => [1]}
1360 0 0 wantarray ? :
0 94 unless defined $ast
1361 1 0 wantarray ? :
1 93 unless exists $ast->{$block_name}
1362 32 61 unless defined $ast->{'generated_blocks'}
1367 3 507 unless defined $line
1368 43 464 if ($line =~ /^BLOCK::\w+/) { }
136 328 elsif ($line =~ /^INS::\w+/) { }
8 320 elsif ($line =~ /^UNARY::\w+/) { }
83 237 elsif ($line =~ /^SET::\w+/) { }
5 232 elsif ($line =~ /^PARAM::(\w+)::(\w+)::(\w+)/) { }
93 139 elsif ($line =~ /^LABEL::(\w+)/) { }
9 130 elsif ($line =~ /^COND::(\d+)::/) { }
130 0 elsif ($line =~ /^SIM::\w+/) { }
1378 5 0 if (exists $ast->{'block_mapping'}{$block_name}) { }
1388 5 0 if ($pblock ne $block_name and $mapping->{'block'} eq $block_name)
1401 0 93 if $self->intermediate_inline
1402 75 18 if $lbl ne '_vic_simulator'
1407 14 3 unless $$blocks[$i - {sign => '+', value => [1]}] =~ /^COND::$cblock::/
1418 92 0 wantarray ? :
1424 0 32 if scalar @{$ast->{'block_stack'};}
1425 0 32 unless defined $ast->{'Main'}
1434 19 12 if keys %$vhref
1444 2 40 if ($typ eq 'string') { }
0 40 elsif ($typ eq 'ARRAY') { }
1 39 elsif ($typ eq 'HASH') { }
1446 0 2 unless defined $data
1450 2 0 if $szdecl
1452 0 0 unless defined $data
1456 0 1 unless defined $data
1457 0 1 unless defined $data->{'TABLE'}
1462 1 0 if $szdecl
1466 20 19 if ($vhref->{$var}{'scope'} eq 'global' or $ast->{'code_config'}{'variable'}{'export'})
1472 3 28 if ($ast->{'tmp_stack_size'})
1475 5 26 if (scalar @global_vars)
1479 1 30 if (scalar @init_vars)
1485 25 55 if $mac =~ /_var$/
1495 5 40 if ($fn =~ /^isr_\w+$/) { }
5 35 elsif ($fn =~ /^_isr_\w+$/) { }
1496 0 5 if (ref $fn_val eq 'ARRAY') { }
1503 5 0 if (ref $fn_val eq 'ARRAY') { }
1509 22 13 if (ref $fn_val eq 'ARRAY') { }
1513 13 0 unless ref $fn_val eq 'ARRAY'
1522 3 28 if scalar @tables
1524 5 26 if (length $isr_code)
1535 19 11 if ($self->simulator and not $self->simulator->disable and $ast->{'Simulator'} || $ast->{'asserts'})
1542 19 0 if defined $init_code
1543 18 1 if scalar @setup_code
1544 12 7 if ($self->simulator->should_autorun)