Branch Coverage

ddb.pm
Criterion Covered Total %
branch 129 188 68.6


line true false branch
11 0 251 if $@
72 0 33028 unless defined $pos
84 0 1679 unless (defined $val)
93 351 1328 if (defined $pos) { }
100 74 277 if ($old_val_len < $val_len) { }
123 52 3457 unless defined $pos
196 251 0 if ($end_pos == 0)
208 0 251 unless pack('N', $check_magic) eq pack('N', $magic)
215 0 251 if $end_pos < $min_size
278 31 0 unless ($msg =~ /\n$/)
281 31 0 if defined $ptr_pos
285 31 0 if $$db{'lock_count'} > 0
293 331 0 unless ($msg =~ /\n$/)
303 0 0 unless defined $$db{'cur_hash'}
306 0 0 if $last_complete == $complete and $$db{'rec_count'} % $show_step
307 0 0 $complete == 100 ? :
316 0 17631 unless &File::Sync::fsync($$db{'fh'})
337 6 2293007 unless ($check_len == $len)
353 7 459843 unless $byte eq $sentinel
359 1265061 502 if ($debug)
361 0 0 defined $ptr_pos ? :
0 1265061 if $pos % 4
382 3822 916 if ($empty < $buf_size)
398 71268 388575 if (@_ > 1)
399 0 71268 if $key_len < 0 or $pos + 9 + $key_len > $end_pos
404 459843 0 wantarray ? :
415 71268 36485 if (@_ > 2)
416 2 71266 if $val_len < 0 or $pos + $rec_len > $end_pos
421 71266 36485 wantarray ? :
433 108104 0 defined $key_len ? :
442 0 27458 unless ($check_len == $len)
463 12808 502 if ($debug)
465 0 0 defined $ptr_pos ? :
0 12808 if $pos % 4
496 1402 3254 unless defined $val_hash
507 4656 0 if ($debug)
508 0 4656 unless length $rec == $db->rec_len(length $key, length $val)
520 4912 0 if ($debug)
521 0 4912 unless $db->tell % 4 == 3
551 256 2721 if ($old_pos < $new_pos + $rec_len) { }
594 250 9441 unless $$ == $$db{'pid'}
596 4020 5671 if ($$db{'lock_count'} > 0) { }
5671 0 elsif ($$db{'lock_count'} == 0) { }
601 0 4020 unless $$db{'lock_type'} == 2
603 0 5671 unless (flock $$db{'fh'}, 2)
618 0 101899 unless $$ == $$db{'pid'}
620 100905 994 if ($$db{'lock_count'} == 0) { }
0 994 elsif ($$db{'lock_count'} < 0) { }
621 0 100905 unless (flock $$db{'fh'}, 1)
637 0 111590 if ($$db{'lock_count'} < 1) { }
106576 5014 elsif ($$db{'lock_count'} == 1) { }
657 251 251 if $$db{'fh'}
659 0 502 if ($$db{'lock_count'} > 0)
665 0 502 unless sysopen $$db{'fh'}, $$db{'filename'}, 66
684 0 388576 unless $pos % 4 == 3 and $pos >= 0
687 388576 0 if ($debug)
688 0 388576 if $loop_test{$pos}++
695 104555 3782 wantarray ? :
108337 280238 if $check_key eq $key
727 4 194 unless defined $k_pos
729 128 66 unless $k_pos > $pos
730 7 59 if $k_pos < $end_pos
756 67353 1 if (defined $pos)
760 1 0 if $debug
763 19378 1052 defined $$db{'cur_hash'} ? :
767 998 19432 unless ($$db{'cur_hash'} < $$db{'hash_size'})
779 15 67459 unless $pos % 4 == 3 and $pos >= 0
782 67459 0 if ($debug)
783 1 67458 if $loop_test{$pos}++
790 67448 0 if ($debug)
791 0 67448 unless $$db{'cur_hash'} == $db->key_hash($key)
796 0 67447 unless $check_val_hash == $val_hash
826 59 3822 unless ($pos < $end_pos)
827 59 0 if $empty_pos < $end_pos
840 3 3819 if ($@)
850 36 3782 unless ($check_pos == $pos)
851 35 1 if ($check_val_hash == $val_hash) { }
852 0 35 if (defined $check_pos) { }
881 0 3782 unless $check_val_hash == $val_hash
888 2977 805 if ($empty_len > 0) { }
920 770 26 unless ($@)
922 9 761 unless defined $pos
928 0 26 unless ($ptr_pos > 0)
956 0 251 unless ref $db_hash
958 0 251 unless tied %db == $db
960 0 0 unless $_[2]
990 20050 100 if fork
1007 9999 99 if fork
1040 1326 51 if fork
1097 10 0 if (my $pid = fork)
1123 107 77 if (exists $db{$k2})
1139 50 50 if ($_ & 1) { }
1190 1 0 if $@
1216 1 0 if $@