Branch Coverage

blib/lib/XBase.pm
Criterion Covered Total %
branch 145 292 49.6


line true false branch
36 19 0 if (scalar(@_) % 2)
43 1 18 if ($filename eq '-')
47 17 13 if (-f $filename . $ext)
63 0 18 unless ($self->read($header, 32) == 32)
84 1 59 if $field_def eq "\r"
86 0 59 if ($read != 31)
95 21 38 if ($type eq 'C') { }
8 30 elsif ($type eq 'L') { }
20 10 elsif ($type =~ /^[NFD]$/) { }
0 10 elsif ($type eq 'I') { }
0 10 elsif ($type eq 'B') { }
10 0 elsif ($type =~ /^[MGP]$/) { }
0 0 elsif ($type eq 'T') { }
0 0 elsif ($type eq '0') { }
0 0 elsif ($type eq 'Y') { }
97 0 21 if ($decimal and not $$self{'openoptions'}{'nolongchars'})
101 1861 0 if ($$self{'ChopBlanks'})
105 0 0 $value eq '' ? :
108 16 0 defined $value ? :
114 4 10 if ($value =~ /^[YyTt]$/)
115 3 7 if ($value =~ /^[NnFf]$/)
119 2 1 $value ? :
3 1 defined $value ? :
125 60 0 $value =~ /\d/ ? :
128 17 0 if (defined $value) { }
145 7 2 unless (defined $memo or $$self{'openoptions'}{'ignorememo'})
146 0 7 unless $memo = $$self{'memo'} = $self->init_memo_field
148 6 4 if (defined $memo and $length == 10) { }
2 2 elsif (defined $memo and $length == 4) { }
149 0 6 if (ref $memo eq 'XBase::Memo::Apollo') { }
155 0 8 if not $value =~ /\d/ or $value < 0
156 8 0 if defined $memo
159 4 0 if defined $memo and defined $_[0] and $_[0] ne ''
160 4 0 defined $value ? :
167 0 4 if $val < 0
168 4 0 if defined $memo
171 2 0 if defined $memo
172 2 0 defined $value ? :
216 0 0 if ($y & 2147483648) { }
224 0 0 if ($value < 0) { }
249 0 18 if ($lastoffset > $$self{'record_len'} and not defined $$self{'openoptions'}{'nolongchars'})
256 0 18 if ($lastoffset != $$self{'record_len'} and not defined $$self{'openoptions'}{'ignorebadheader'})
261 1 17 if ($$self{'openoptions'}{'recompute_lastrecno'})
284 0 7 if defined $$self{'memo'}
289 0 7 if (defined $$self{'openoptions'}{'memofile'})
296 7 3 if $memoname =~ s/\.dbf$/.$_/i || $memoname =~ s/(\.dbf)?$/.$_/i and $memo = 'XBase::Memo'->new($memoname, %options)
306 2 3 if (defined $$self{'memo'})
330 0 14 unless defined(my $num = $self->field_name_to_num($name))
335 0 2 unless defined(my $num = $self->field_name_to_num($name))
340 0 0 unless defined(my $num = $self->field_name_to_num($name))
381 2 0 if (ref $self)
383 1 1 $year >= 70 ? :
389 2 0 if ref $version
392 0 2 if ($version == 48 or $version == 245) { }
0 2 elsif ($version & 8) { }
2 0 elsif ($version & 128) { }
401 0 2 if (exists $$result{'foxpro'})
404 0 2 if (exists $$result{'memo'}) { }
2 0 elsif (exists $$result{'dbt'}) { }
428 0 0 if (defined $table)
430 0 0 if ($@) { }
441 0 0 if (defined $fields)
442 0 0 if (ref $fields eq 'ARRAY') { }
448 0 0 if (defined $self->field_name_to_num($fields[$i])) { }
0 0 elsif ($fields[$i] =~ /^(.*)-(.*)/) { }
454 0 0 if ($start eq '')
457 0 0 if ($end eq '')
462 0 0 if ($start ne '' and not defined $start_num)
465 0 0 if ($end ne '' and not defined $end_num)
468 0 0 unless (defined $start and defined $end)
481 0 0 if (@unknown_fields)
487 0 0 if (defined $table) { }
491 0 0 if ($_[0]) { }
496 0 0 defined $_ ? :
520 0 1 unless my(@list) = $self->get_record($num)
523 1 0 if wantarray
528 2 1543 unless my $data = $self->read_record($num)
529 100 1443 unless (@fieldnums)
534 1953 0 if defined $_
535 1953 0 defined $e ? :
538 1953 0 defined $_ && defined $$rproc[$_] ? :
560 3 1540 if ($value eq '*') { }
1540 0 elsif ($value eq ' ') { }
585 1 13 if (defined $$self{'attached_index_columns'})
591 2 0 if ($old_data[$nf] ne $data[$nf])
632 0 0 unless %olddata
640 0 16 unless my $ret = $self->SUPER::write_record($num, @_)
642 13 3 if ($num > $self->last_record)
644 0 13 unless $self->update_last_record($num)
646 0 16 unless $self->update_last_change
665 11 7 if defined $$self{'updated_today'}
666 7 0 if $y >= 100
667 0 7 unless $self->write_to(1, pack('C3', ($y, $m, $d)))
683 0 2 if (ref $class)
688 2 0 unless (defined $version)
689 0 2 if (defined $options{'memofile'} and $options{'memofile'} =~ /\.fpt$/i) { }
699 0 8 unless (defined $options{$key})
712 0 7 unless defined $name
715 0 7 unless defined $type
720 0 7 unless (defined $length)
721 0 0 if ($type eq 'C') { }
0 0 elsif ($type =~ /^[TD]$/) { }
0 0 elsif ($type =~ /^[NF]$/) { }
726 1 6 if ($type =~ /^[MBGP]$/) { }
1 5 elsif ($type eq 'L') { }
0 5 elsif ($type eq 'Y') { }
730 3 4 unless (defined $decimal)
736 2 5 if ($type eq 'C')
742 1 6 if ($type eq 'M')
744 1 0 if ($version != 48)
771 1 1 if (defined $newname and not $newname =~ /\.dbf$/)
774 0 2 unless $tmp->create_file($newname, 448)
775 0 2 unless $tmp->write_to(0, $header)
779 1 1 if ($needmemo)
782 1 0 unless (defined $dbtname)
784 0 1 if ($version == 48 or $version == 245) { }
785 0 0 unless $dbtname =~ s/\.DBF$/.FPT/
787 1 0 unless $dbtname =~ s/\.DBF$/.DBT/
792 0 1 if $version == 48
793 0 1 unless $dbttmp->create('name', $dbtname, 'version', $memoversion, 'dbf_filename', $basename)
804 1 0 if (ref $self)
805 1 0 if (defined $$self{'memo'})
816 0 0 unless my $ret = $self->SUPER::locksh
817 0 0 if (defined $$self{'memo'})
818 0 0 unless ($$self{'memo'}->locksh)
827 0 0 unless my $ret = $self->SUPER::lockex
828 0 0 if (defined $$self{'memo'})
829 0 0 unless ($$self{'memo'}->lockex)
838 0 0 if defined $$self{'memo'}
850 0 1 unless (my $index = $self->XBase::Index::new($indexfile))
855 0 1 if $XBase::Index::VERBOSE
858 1 0 if (@tags) { }
862 0 5 unless (my $index = $self->XBase::Index::new($indexfile, 'tag', $tag))
876 0 5 if $XBase::Index::VERBOSE
878 1 4 unless defined $$self{'attached_index'}
893 1 1 unless (@_)
902 0 0 if (@_)
909 4 4 if (ref $file eq 'ARRAY')
912 0 4 if (defined $$file[2])
918 6 2 unless (@_)
922 0 8 unless (my $index = 'XBase::Index'->new($file, 'dbf', $self, @tagopts))
924 0 8 unless ($index->prepare_select)
937 110 2 if (defined $recno) { }
942 110 0 if (@result and not $del)
954 0 0 if (@data)
993 1317 0 unless ($del)