Branch Coverage

blib/lib/Cache/Mmap.pm
Criterion Covered Total %
branch 107 156 68.6


line true false branch
239 3 8 unless $options
246 0 44 unless defined $$self{$_} and $$self{$_} =~ /^[1-9]\d*$/s
249 0 11 unless $$self{'pagesize'} >= $maxheadsize
252 0 33 unless not $$self{$_} or ref $$self{$_} eq 'CODE'
260 0 11 if ((my $i_pages = int $n_pages) != $n_pages)
267 0 11 unless sysopen $fh, $filename, O_RDWR() | O_CREAT(), $$self{'permissions'}
310 2 47
319 9 38 if (not $found or $expired)
320 4 5 $$self{'read'} ? :
322 0 9 @_read == 1 ? :
323 7 2 if not defined $new_found
324 7 2 unless $new_found
326 1 8 if ($new_found == 3402498049) { }
1 7 elsif ($new_found == 3402498051) { }
338 1 0 if $found
343 42 5 if ($found)
346 2 40 if ($expired and not $flags & 1)
359 6 34 if ($poff)
368 7 40 if (not $found)
373 0 7 if ($found or $$self{'cachenegative'})
385 2 47 if $err
406 28 0 if ($size <= $bsize) { }
0 0 elsif (my $wsub = $$self{'write'}) { }
411 0 28
417 3 25 if ($found)
434 0 28 if ($$self{'writethrough'} and my $write = $$self{'write'})
441 0 28 if $err
472 0 3
478 3 0 if ($found)
480 0 3 if (my $dsub = $$self{'delete'} and not $flags & 1)
499 0 3 if $err
546 0 65
556 0 20 if (not $size)
562 0 20 if $expiry and time - $time > $expiry
565 10 10 if ($details) { }
566 5 5 $details > 1 ? :
587 0 65 if $err
603 0 0 unless $self->_lock(0)
607 0 0
624 0 0 if $err
687 0 0 @_ ? :
763 0 11 unless $self->_lock(0)
767 2 9
773 3 8 if ($size_cur >= $headsize)
775 0 3 if ((my $bytes = sysread($$self{'_fh'}, $head, $headsize)) != $headsize)
779 1 2 unless $mg == 22727374
781 1 1 unless ($format += 0) == 1
795 8 1 if ($size_cur < $size)
797 0 8 unless sysseek $$self{'_fh'}, SEEK_END(), 0
800 0 48 unless my $len = syswrite($$self{'_fh'}, $pad, 1024)
804 0 8 unless -s $$self{'_fh'} >= $size
809 8 1 if (not $magic_ok)
812 7 1 if $$self{$opt}
817 0 8 unless sysseek $$self{'_fh'}, SEEK_SET(), 0
819 0 8 unless syswrite($$self{'_fh'}, $head, $headsize) == $headsize
827 0 9 unless (&mmap(, $size, $$self{'_fh'}))
832 0 9 unless (length $$self{'_mmap'} eq $size)
844 2 9 if $err
856 9 2 if exists $$self{'_mmap'}
871 145 11 $offset ? :
903 0 28 if $size > $bsize
914 1 27 if ($filled > $bsize)
919 0 1 if $poff >= $filled
925 0 1 if (my $wsub = $$self{'write'} && !$$self{'writethrough'})
929 0 0 if (not $size)
937 0 0 if ($flags & 1)
993 1 71 if ($off >= $b_end)
998 1 70 if (not $size)
1003 0 1 if ($poff)
1009 48 22 if ($self->_decode(substr($$self{'_mmap'}, $off + $eheadsize, $klen), 1) eq $key)
1017 30 48 unless $found
1020 8 40 if ($found and my $exp = $self->expiry)
1036 0 105 if (not defined $value) { }
92 13 elsif ($$self{'strings'} or $is_key) { }
1041 89 3 if ($eval eq $value) { }
1063 0 138 if ($value eq '') { }
1068 3 135 if ($code eq 'U') { }
105 30 elsif ($$self{'strings'} or $is_key) { }