Branch Coverage

blib/lib/MIDI/Opus.pm
Criterion Covered Total %
branch 57 136 41.9


line true false branch
85 11 0 defined $_[0] && ref $_[0] eq 'HASH' ? :
89 0 11 if $MIDI::Opus::Debug
91 0 11 if $$options_r{'no_opus_init'}
94 9 2 if (exists $$options_r{'from_file'} and defined $$options_r{'from_file'} and length $$options_r{'from_file'}) { }
0 2 elsif (exists $$options_r{'from_handle'} and defined $$options_r{'from_handle'} and length $$options_r{'from_handle'}) { }
130 0 0 if $$new{'tracks'}
140 11 0 ref $_[0] eq 'HASH' ? :
142 0 11 if $MIDI::Opus::Debug
143 0 11 if ($MIDI::Opus::Debug)
144 0 0 if (%$options_r) { }
150 2 9 defined $$options_r{'format'} ? :
152 2 9 defined $$options_r{'ticks'} ? :
155 0 11 if exists $$options_r{'tracks_r'} and not exists $$options_r{'tracks'}
163 2 9 defined $$options_r{'tracks'} && ref $$options_r{'tracks'} eq 'ARRAY' ? :
187 0 12 if @_
215 1 24 if ref $_[0]
228 2 8 if defined $_[0]
241 2 8 if defined $_[0]
265 1 0 ref $_[1] eq 'HASH' ? :
267 0 1 if ($grid < 1)
268 0 1 if $grid eq 1
297 0 0 ref $_[1] eq 'HASH' ? :
299 0 0 if ($$options_r{'flat'})
314 0 0 if ($$options_r{'dump_tracks'}) { }
319 0 0 if (ref $track) { }
351 0 2 ref $_[2] eq 'HASH' ? :
353 0 2 unless length $destination
354 0 2 unless (open OUT_MIDI, ">$destination")
358 0 2 unless close OUT_MIDI
373 9 0 ref $_[2] eq 'HASH' ? :
375 0 9 unless length $source
376 0 9 unless (open IN_MIDI, "<$source")
380 0 9 unless $size
384 0 9 unless close IN_MIDI
406 2 0 ref $_[2] eq 'HASH' ? :
411 0 2 if $tracks == 0
414 2 0 if (defined $$opus{'format'}) { }
417 0 0 if ($tracks == 0) { }
0 0 elsif ($tracks == 1) { }
425 2 0 defined $$opus{'ticks'} ? :
458 9 0 ref $_[2] eq 'HASH' ? :
460 9 0 if defined $_[3]
467 0 9 if exists $$options_r{'track_size'}
470 0 9 unless read $fh, $in, 14
474 9 0 if (defined $file_size_left)
480 0 9 unless $id eq 'MThd'
482 0 9 unless $length == 6
488 0 9 if $MIDI::Opus::Debug
494 0 15 if $MIDI::Opus::Debug
496 15 0 if (defined $file_size_left)
498 0 15 if $file_size_left < 0
503 0 15 unless read $fh, $header, 8
507 0 15 if (defined $track_size_limit and $track_size_limit > $length)
512 15 0 if (defined $file_size_left)
514 0 15 if $file_size_left < 0
521 15 0 if ($length == length $data) { }
535 0 9 unless $tracks_expected == $track_count
538 0 9 if $track_count == 0
598 0 0 ref $_[1] ? :
607 0 0 if @$score_r
608 0 0 if $track_time > $opus_time
613 0 0 unless $opus_time
624 0 0 length $$options_r{'bg_color'} ? :
629 0 0 unless @MIDI::Opus::Channel_colors
636 0 0 ref $$options_r{'channel_colors'} ? :
642 0 0 unless $$event_r[0] eq 'note'
658 0 0 if $GD_used
659 0 0 if $@