Branch Coverage

blib/lib/Cache/FastMmap.pm
Criterion Covered Total %
branch 120 182 65.9


line true false branch
547 0 25 ref $_[0] eq 'HASH' ? :
554 25 0 unless ($share_file)
557 0 25 $^O eq 'MSWin32' ? :
560 0 25 if ref $share_file
563 24 1 $Args{'init_file'} ? :
564 0 25 $Args{'test_file'} ? :
565 1 24 $Args{'enable_stats'} ? :
566 0 25 $Args{'catch_deadlocks'} ? :
569 25 0 unless (exists $Args{'unlink_on_exit'})
570 0 25 -f $share_file ? :
574 0 5 $Args{'raw_values'} ? :
576 5 20 if ($serializer)
577 5 0 if ($serializer eq 'storable') { }
0 0 elsif ($serializer eq 'sereal') { }
0 0 elsif ($serializer eq 'json') { }
578 0 5 unless eval 'require Storable;'
583 0 0 unless eval 'require Sereal::Encoder; require Sereal::Decoder;'
590 0 0 unless eval 'require JSON;'
601 3 21 $Args{'compress'} ? :
609 4 21 if ($compressor)
613 0 4 if (not eval "require $compressor_module;") { }
617 0 4 if ($compressor_module eq 'Compress::LZ4' or $compressor_module eq 'Compress::Snappy') { }
4 0 elsif ($compressor_module eq 'Compress::Zlib') { }
633 1 24 if ($empty_on_exit)
634 0 1 unless eval 'use Scalar::Util qw(weaken); 1;'
648 0 25 if ($cache_size = $Args{'cache_size'}) { }
649 0 0 if $cache_size =~ s/([km])$//i
651 0 0 if ($num_pages = $Args{'num_pages'}) { }
653 0 0 if $page_size < 4096
657 0 0 if $page_size =~ s/([km])$//i
658 0 0 if $page_size < 4096
662 0 0 if ($num_pages * $page_size <= $cache_size) { }
679 0 25 if $page_size =~ s/([km])$//i
723 1 24 if $empty_on_exit
751 13116 152658 if (not $Found and my $read_cb = $Self->{'read_cb'})
755 1 13115 if $Self->{'allow_recursive'}
758 1 13115 if $Self->{'allow_recursive'}
761 1 13115 if ($Err)
766 13115 0 if (defined $Val or $Self->{'cache_not_found'})
771 2 13113 if $Self->{'serialize'}
772 0 13115 if $Self->{'compress'}
776 13114 1 defined $Val ? :
786 145767 20006 unless $SkipUnlock
789 2 150249 if defined $Val and $Self->{'compress'}
790 99309 50942 if defined $Val and $Self->{'deserialize'}
793 20006 145767 if $SkipUnlock
814 3507 37378 $Self->{'serialize'} ? :
815 2 40883 if $Self->{'compress'}
818 15006 17 ref $_[3] ? :
15023 25862 defined $_[3] ? :
819 17 40868 defined($Opts && $Opts->{'expire_time'}) ? :
828 15006 25879 if ($Unlock) { }
839 40884 1 defined $Val ? :
843 6106 34779 $write_back ? :
850 3000 37885 if (not $write_back && $DidStore and my $write_cb = $Self->{'write_cb'})
914 15006 0 if (@NewValue)
919 0 15006 wantarray ? :
941 5000 6301 if ($Unlock) { }
952 301 11000 if (!$DidDel || $DidDel && !($Flags & 1) and my $delete_cb = $Self->{'delete_cb'})
974 5000 0 wantarray ? :
1018 0 5 $_[0] ? :
1040 11 1 if $Mode <= 1 or $Mode == 2 and not $Uncompress and not $Deserialize
1048 2 0 if (defined $Val)
1049 0 2 if $Uncompress
1050 2 0 if $Deserialize
1083 178 89 if $Clear
1142 0 4 unless $Found
1145 0 4 if defined $Val and $Self->{'compress'}
1146 0 4 if defined $Val and $Self->{'deserialize'}
1167 0 0 ref $_[3] ? :
0 2 defined $_[3] ? :
1168 0 2 defined($Opts && $Opts->{'expire_time'}) ? :
1178 0 4 if $Self->{'serialize'}
1179 0 4 if $Self->{'compress'}
1241 14732 39812 $Self->{'write_back'} && $WB ? :
1243 14732 39812 $write_cb ? :
1248 8024 6104 unless $_->{'flags'} & 1
1251 6103 1 if (defined $Val)
1252 0 6103 if $Uncompress
1253 2 6101 if $Deserialize
1268 198766 1 if &fc_is_locked($Cache)
1276 2 40 if $expire_time eq 'now'
1277 2 38 if $expire_time eq 'never'
1279 11 27 $expire_time =~ /^(\d+)\s*([mhdws]?)/i ? :
1286 0 23 if $Self->{'cleaned'}
1290 1 0 if ($Self->{'empty_on_exit'} and $Cache and $Self->{'pid'} == $$)
1294 23 0 if ($Cache)
1301 21 2 if $Self->{'unlink_on_exit'} and $Self->{'pid'} == $$
1308 1 22 if $Self->{'empty_on_exit'}
1314 0 0 if $Self
1344 198767 0 if $$Ref