Branch Coverage

blib/lib/Audio/SID.pm
Criterion Covered Total %
branch 0 280 0.0


line true false branch
46 0 0 if (defined $_[0])
48 0 0 $self->read(%params) ? :
99 0 0 if ($_[0] =~ /^\-filedata$/i and defined $_[1]) { }
0 0 elsif ($_[0] =~ /^\-file(name)|(handle)$/i and defined $_[1]) { }
0 0 elsif (defined $_[0] and not defined $_[1]) { }
0 0 elsif (defined $_[0]) { }
114 0 0 if (not defined $filedata) { }
119 0 0 if (ref \$filename ne 'GLOB') { }
121 0 0 unless defined $filename
123 0 0 unless ($filename)
129 0 0 unless ($FH = 'FileHandle'->new("< $filename"))
150 0 0 unless ($size)
160 0 0 unless ($SID eq 'PSID' and $version == 1 || $version == 2 or $SID eq 'RSID' and $version == 2)
175 0 0 if (not defined $filedata) { }
185 0 0 if ($size != $dataOffset - 8)
196 0 0 if ($version > 1) { }
220 0 0 if (not defined $filedata) { }
229 0 0 unless (defined $size)
237 0 0 if (ref \$filename ne 'GLOB' and not defined $filedata)
259 0 0 if ($_[0] =~ /^\-file(name)|(handle)$/i and defined $_[1]) { }
0 0 elsif (defined $_[0] and not defined $_[1]) { }
0 0 elsif (defined $_[0]) { }
275 0 0 if (ref \$filename ne 'GLOB') { }
276 0 0 unless defined $filename
278 0 0 unless ($filename)
283 0 0 unless ($FH = 'FileHandle'->new("> $filename"))
296 0 0 if ($$self{'validateWrite'})
314 0 0 if ($$self{'SIDdata'}{'version'} > 1)
323 0 0 if (ref \$filename ne 'GLOB')
344 0 0 unless defined wantarray
346 0 0 unless (defined $fieldname)
349 0 0 if (wantarray) { }
359 0 0 if $fieldname =~ /^copyright$/
360 0 0 if $fieldname =~ /^name$/
362 0 0 unless (grep /^$fieldname$/, @SIDfieldNames)
388 0 0 if ($$self{'SIDdata'}{'data'} and $$self{'SIDdata'}{'loadAddress'} == 0) { }
401 0 0 if not defined $songnumber or $songnumber < 1
403 0 0 if ($songnumber > $$self{'SIDdata'}{'songs'})
408 0 0 if $songnumber > 32
416 0 0 unless defined $$self{'SIDdata'}{'flags'}
431 0 0 unless defined $$self{'SIDdata'}{'flags'}
432 0 0 if $self->isRSID
453 0 0 unless defined $$self{'SIDdata'}{'flags'}
454 0 0 unless $self->isRSID
468 0 0 unless defined $$self{'SIDdata'}{'flags'}
477 0 0 unless defined $$self{'SIDdata'}{'flags'}
481 0 0 if ($clock == 0) { }
0 0 elsif ($clock == 1) { }
0 0 elsif ($clock == 2) { }
0 0 elsif ($clock == 3) { }
500 0 0 unless defined $$self{'SIDdata'}{'flags'}
509 0 0 unless defined $$self{'SIDdata'}{'flags'}
513 0 0 if ($SIDModel == 0) { }
0 0 elsif ($SIDModel == 1) { }
0 0 elsif ($SIDModel == 2) { }
0 0 elsif ($SIDModel == 3) { }
542 0 0 if $fieldname =~ /^copyright$/
543 0 0 if $fieldname =~ /^name$/
545 0 0 unless (grep /^$fieldname$/, @SIDfieldNames)
552 0 0 if ($fieldname eq 'magicID')
553 0 0 if ($SIDhash{$fieldname} ne 'PSID' and $SIDhash{$fieldname} ne 'RSID')
558 0 0 if ($SIDhash{$fieldname} ne $$self{'SIDdata'}{'magicID'})
563 0 0 if ($fieldname eq 'version')
564 0 0 if ($SIDhash{$fieldname} != 1 and $SIDhash{$fieldname} != 2)
570 0 0 if ($$self{'SIDdata'}{'version'} < 2 and $fieldname eq 'magicID' || $fieldname eq 'flags' || $fieldname eq 'reserved' || $fieldname eq 'startPage' || $fieldname eq 'pageLength')
579 0 0 if ($fieldname eq 'title' or $fieldname eq 'author' or $fieldname eq 'released')
586 0 0 if ($$self{'SIDdata'}{'version'} == 1) { }
0 0 elsif ($$self{'SIDdata'}{'version'} == 2) { }
602 0 0 if ($$self{'SIDdata'}{'dataOffset'} <= 124) { }
615 0 0 unless (defined $$self{'SIDdata'}{'flags'})
619 0 0 unless (defined $$self{'SIDdata'}{'startPage'})
623 0 0 unless (defined $$self{'SIDdata'}{'pageLength'})
627 0 0 unless (defined $$self{'SIDdata'}{'reserved'})
631 0 0 if ($changePSIDSpecific)
633 0 0 unless ($SIDhash{'flags'})
634 0 0 if ($self->isRSID) { }
644 0 0 if ($self->isRSID)
651 0 0 if ($$self{'SIDdata'}{'loadAddress'} != 0)
657 0 0 if ($self->getC64BASIC)
678 0 0 unless (defined $songnumber)
683 0 0 unless (defined $value)
688 0 0 if ($songnumber > $$self{'SIDdata'}{'songs'} or $songnumber < 1)
693 0 0 if ($value ne 0 and $value ne 1)
698 0 0 if $songnumber > 32
699 0 0 if $songnumber < 1
711 0 0 unless (defined $$self{'SIDdata'}{'flags'})
716 0 0 if ($MUSplayer ne 0 and $MUSplayer ne 1)
731 0 0 if ($self->isRSID)
736 0 0 unless (defined $$self{'SIDdata'}{'flags'})
741 0 0 if ($PlaySID ne 0 and $PlaySID ne 1)
756 0 0 unless ($self->isRSID)
761 0 0 unless (defined $$self{'SIDdata'}{'flags'})
766 0 0 if ($C64BASIC ne 0 and $C64BASIC ne 1)
777 0 0 if ($C64BASIC)
785 0 0 unless (defined $$self{'SIDdata'}{'flags'})
790 0 0 if ($clock < 0 or $clock > 3)
805 0 0 unless (defined $$self{'SIDdata'}{'flags'})
810 0 0 if ($clock =~ /^(unknown|none|neither)$/i) { }
0 0 elsif ($clock =~ /^PAL$/i) { }
0 0 elsif ($clock =~ /^NTSC$/i) { }
0 0 elsif ($clock =~ /^(any|both|either)$/i) { }
833 0 0 unless (defined $$self{'SIDdata'}{'flags'})
838 0 0 if ($SIDModel < 0 or $SIDModel > 3)
853 0 0 unless (defined $$self{'SIDdata'}{'flags'})
858 0 0 if ($SIDModel =~ /^(unknown|none|neither)$/i) { }
0 0 elsif ($SIDModel =~ /^6581$/ or $SIDModel == 6581) { }
0 0 elsif ($SIDModel =~ /^8580$/i or $SIDModel == 8580) { }
0 0 elsif ($SIDModel =~ /^(any|both|either)$/i) { }
890 0 0 if ($$self{'SIDdata'}{'loadAddress'} == 0 and $$self{'SIDdata'}{'data'}) { }
907 0 0 if (($speed & 1 << $i) != 0 or $self->isRSID) { }
918 0 0 if ($$self{'SIDdata'}{'version'} > 1 and $clock == 2 and not $oldMD5)
941 0 0 if ($$self{'SIDdata'}{'version'} < 2)
946 0 0 if ($self->isRSID)
951 0 0 if ($$self{'SIDdata'}{'dataOffset'} != 124)
970 0 0 if (length $$self{'SIDdata'}{$field} > 31)
980 0 0 if ($self->isRSID and $$self{'SIDdata'}{'initAddress'} > 0 && $$self{'SIDdata'}{'initAddress'} < 2024 || $$self{'SIDdata'}{'initAddress'} >= 40960 && $$self{'SIDdata'}{'initAddress'} < 49152 || $$self{'SIDdata'}{'initAddress'} >= 53248 && $$self{'SIDdata'}{'initAddress'} <= 65535 || $$self{'SIDdata'}{'initAddress'} < $self->getRealLoadAddress || $$self{'SIDdata'}{'initAddress'} > $self->getRealLoadAddress + length($$self{'SIDdata'}{'data'}) - 3 || $self->getC64BASIC)
1000 0 0 if ($$self{'SIDdata'}{'loadAddress'} != 0) { }
0 0 elsif ($self->isRSID and $self->getRealLoadAddress < 2024) { }
1003 0 0 if ($self->isRSID and $$self{'SIDdata'}{'loadAddress'} < 2024)
1021 0 0 if ($self->isRSID and $$self{'SIDdata'}{'initAddress'} < $self->getRealLoadAddress || $$self{'SIDdata'}{'initAddress'} > $self->getRealLoadAddress + length($$self{'SIDdata'}{'data'}) - 3)
1034 0 0 if ($$self{'SIDdata'}{$field} < 0 or $$self{'SIDdata'}{$field} > 65535)
1042 0 0 if (not defined $$self{'SIDdata'}{$field} or $$self{'SIDdata'}{$field} < 0 or $$self{'SIDdata'}{$field} > 255)
1049 0 0 if ($$self{'SIDdata'}{'songs'} > 256)
1055 0 0 if ($$self{'SIDdata'}{'songs'} < 1)
1061 0 0 if ($$self{'SIDdata'}{'startSong'} > $$self{'SIDdata'}{'songs'})
1066 0 0 unless ($self->isRSID)
1072 0 0 if ($maxSongs > 32)
1082 0 0 if (not defined $$self{'SIDdata'}{'flags'}) { }
1091 0 0 if (not $self->isRSID) { }
1104 0 0 if (not $self->isRSID) { }
1112 0 0 if ($$self{'SIDdata'}{'startPage'} == 0 or $$self{'SIDdata'}{'startPage'} == 255) { }
0 0 elsif (($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 > 65535) { }
0 0 elsif ($$self{'SIDdata'}{'pageLength'} == 0) { }
1126 0 0 if ($$self{'SIDdata'}{'startPage'} >= 160 and $$self{'SIDdata'}{'startPage'} < 192 or $$self{'SIDdata'}{'startPage'} >= 208 and $$self{'SIDdata'}{'startPage'} < 255 or $$self{'SIDdata'}{'startPage'} > 0 and $$self{'SIDdata'}{'startPage'} < 4)
1135 0 0 if (($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 >= 40960 and ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 < 49152 or ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 >= 53248 and ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 <= 65535 or ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 > 0 and ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 < 1024)
1144 0 0 if ($$self{'SIDdata'}{'startPage'} < 160 and ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 >= 49152)
1152 0 0 if ($$self{'SIDdata'}{'startPage'} << 8 >= $self->getRealLoadAddress and $$self{'SIDdata'}{'startPage'} << 8 <= $self->getRealLoadAddress + length($$self{'SIDdata'}{'data'}) - 3)
1160 0 0 if (($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 >= $self->getRealLoadAddress and ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 <= $self->getRealLoadAddress + length($$self{'SIDdata'}{'data'}) - 3)
1168 0 0 if ($$self{'SIDdata'}{'startPage'} << 8 < $self->getRealLoadAddress and ($$self{'SIDdata'}{'startPage'} << 8) + ($$self{'SIDdata'}{'pageLength'} << 8) - 1 > $self->getRealLoadAddress + length($$self{'SIDdata'}{'data'}) - 3)
1180 0 0 if ($$self{'PADDING'})