Branch Coverage

blib/lib/Cache/FastMmap.pm
Criterion Covered Total %
branch 122 182 67.0


line true false branch
550 0 8027 ref $_[0] eq 'HASH' ? :
557 8027 0 unless ($share_file)
562 0 8027 if ref $share_file
566 4025 4002 $Args{'init_file'} ? :
567 0 8027 $Args{'test_file'} ? :
568 1 8026 $Args{'enable_stats'} ? :
569 0 8027 $Args{'catch_deadlocks'} ? :
572 8027 0 unless (exists $Args{'unlink_on_exit'})
573 0 8027 -f $share_file ? :
577 0 5 $Args{'raw_values'} ? :
579 5 8022 if ($serializer)
580 5 0 if ($serializer eq 'storable') { }
0 0 elsif ($serializer eq 'sereal') { }
0 0 elsif ($serializer eq 'json') { }
581 0 5 unless eval 'require Storable;'
586 0 0 unless eval 'require Sereal::Encoder; require Sereal::Decoder;'
593 0 0 unless eval 'require JSON;'
604 3 8023 $Args{'compress'} ? :
612 4 8023 if ($compressor)
616 0 4 if (not eval "require $compressor_module;") { }
620 0 4 if ($compressor_module eq 'Compress::LZ4' or $compressor_module eq 'Compress::Snappy') { }
4 0 elsif ($compressor_module eq 'Compress::Zlib') { }
636 1 8026 if ($empty_on_exit)
637 0 1 unless eval 'use Scalar::Util qw(weaken); 1;'
651 0 8027 if ($cache_size = $Args{'cache_size'}) { }
652 0 0 if $cache_size =~ s/([km])$//i
654 0 0 if ($num_pages = $Args{'num_pages'}) { }
656 0 0 if $page_size < 4096
660 0 0 if $page_size =~ s/([km])$//i
661 0 0 if $page_size < 4096
665 0 0 if ($num_pages * $page_size <= $cache_size) { }
682 0 8027 if $page_size =~ s/([km])$//i
717 0 8027 if defined $permissions
726 1 8026 if $empty_on_exit
754 21262 164637 if (not $Found and my $read_cb = $Self->{'read_cb'})
758 1 21261 if $Self->{'allow_recursive'}
761 1 21261 if $Self->{'allow_recursive'}
764 1 21261 if ($Err)
769 12923 8338 if (defined $Val or $Self->{'cache_not_found'})
774 2 12921 if $Self->{'serialize'}
775 0 12923 if $Self->{'compress'}
779 12922 1 defined $Val ? :
789 165889 20009 unless $SkipUnlock
792 2 159047 if defined $Val and $Self->{'compress'}
793 99309 59740 if defined $Val and $Self->{'deserialize'}
796 20009 165889 if $SkipUnlock
817 3507 87461 $Self->{'serialize'} ? :
818 2 90966 if $Self->{'compress'}
821 15009 17 ref $_[3] ? :
15026 75942 defined $_[3] ? :
822 17 90951 defined($Opts && $Opts->{'expire_time'}) ? :
831 15009 75959 if ($Unlock) { }
842 82947 8021 defined $Val ? :
846 56206 34762 $write_back ? :
853 3000 87968 if (not $write_back && $DidStore and my $write_cb = $Self->{'write_cb'})
917 15009 0 if (@NewValue)
922 3 15006 wantarray ? :
944 5000 6301 if ($Unlock) { }
955 301 11000 if (!$DidDel || $DidDel && !($Flags & 1) and my $delete_cb = $Self->{'delete_cb'})
977 5000 0 wantarray ? :
1021 0 5 $_[0] ? :
1043 614 1 if $Mode <= 1 or $Mode == 2 and not $Uncompress and not $Deserialize
1051 2 0 if (defined $Val)
1052 0 2 if $Uncompress
1053 2 0 if $Deserialize
1086 178 89 if $Clear
1145 0 4 unless $Found
1148 0 4 if defined $Val and $Self->{'compress'}
1149 0 4 if defined $Val and $Self->{'deserialize'}
1170 0 0 ref $_[3] ? :
0 2 defined $_[3] ? :
1171 0 2 defined($Opts && $Opts->{'expire_time'}) ? :
1181 0 4 if $Self->{'serialize'}
1182 0 4 if $Self->{'compress'}
1244 64787 39665 $Self->{'write_back'} && $WB ? :
1246 64787 39665 $write_cb ? :
1251 7956 32687 unless $_->{'flags'} & 1
1254 29429 3258 if (defined $Val)
1255 0 29429 if $Uncompress
1256 2 29427 if $Deserialize
1271 268988 1 if &fc_is_locked($Cache)
1279 2 8042 if $expire_time eq 'now'
1280 2 8040 if $expire_time eq 'never'
1282 11 8029 $expire_time =~ /^(\d+)\s*([mhdws]?)/i ? :
1289 0 8024 if $Self->{'cleaned'}
1293 1 0 if ($Self->{'empty_on_exit'} and $Cache and $Self->{'pid'} == $$)
1297 8024 0 if ($Cache)
1304 8022 2 if $Self->{'unlink_on_exit'} and $Self->{'pid'} == $$
1311 1 8023 if $Self->{'empty_on_exit'}
1317 0 0 if $Self
1347 268989 0 if $$Ref