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 =~ /^[WMGP]$/) { }
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) { }
150 7 2 unless (defined $memo or $self->{'openoptions'}{'ignorememo'})
151 0 7 unless $memo = $self->{'memo'} = $self->init_memo_field
153 6 4 if (defined $memo and $length == 10) { }
2 2 elsif (defined $memo and $length == 4) { }
154 0 6 if (ref $memo eq 'XBase::Memo::Apollo') { }
160 0 8 if not $value =~ /\d/ or $value < 0
161 8 0 if defined $memo
164 4 0 if defined $memo and defined $_[0] and $_[0] ne ''
165 4 0 defined $value ? :
172 0 4 if $val < 0
173 4 0 if defined $memo
176 2 0 if defined $memo
177 2 0 defined $value ? :
221 0 0 if ($y & 2147483648) { }
229 0 0 if ($value < 0) { }
254 0 18 if ($lastoffset > $self->{'record_len'} and not defined $self->{'openoptions'}{'nolongchars'})
261 0 18 if ($lastoffset != $self->{'record_len'} and not defined $self->{'openoptions'}{'ignorebadheader'})
266 1 17 if ($self->{'openoptions'}{'recompute_lastrecno'})
289 0 7 if defined $self->{'memo'}
294 0 7 if (defined $self->{'openoptions'}{'memofile'})
301 7 3 if $memoname =~ s/\.dbf$/.$_/i || $memoname =~ s/(\.dbf)?$/.$_/i and $memo = 'XBase::Memo'->new($memoname, %options)
311 2 3 if (defined $self->{'memo'})
335 0 14 unless defined(my $num = $self->field_name_to_num($name))
340 0 2 unless defined(my $num = $self->field_name_to_num($name))
345 0 0 unless defined(my $num = $self->field_name_to_num($name))
386 2 0 if (ref $self)
388 1 1 $year >= 70 ? :
394 2 0 if ref $version
397 0 2 if ($version == 48 or $version == 245) { }
0 2 elsif ($version & 8) { }
2 0 elsif ($version & 128) { }
406 0 2 if (exists $result->{'foxpro'})
409 0 2 if (exists $result->{'memo'}) { }
2 0 elsif (exists $result->{'dbt'}) { }
433 0 0 if (defined $table)
435 0 0 if ($@) { }
446 0 0 if (defined $fields)
447 0 0 if (ref $fields eq 'ARRAY') { }
453 0 0 if (defined $self->field_name_to_num($fields[$i])) { }
0 0 elsif ($fields[$i] =~ /^(.*)-(.*)/) { }
459 0 0 if ($start eq '')
462 0 0 if ($end eq '')
467 0 0 if ($start ne '' and not defined $start_num)
470 0 0 if ($end ne '' and not defined $end_num)
473 0 0 unless (defined $start and defined $end)
486 0 0 if (@unknown_fields)
492 0 0 if (defined $table) { }
496 0 0 if ($_[0]) { }
501 0 0 defined $_ ? :
525 0 1 unless my(@list) = $self->get_record($num)
528 1 0 if wantarray
533 2 1543 unless my $data = $self->read_record($num)
534 100 1443 unless (@fieldnums)
539 1953 0 if defined $_
540 1953 0 defined $e ? :
543 1953 0 defined $_ && defined $rproc->[$_] ? :
565 3 1540 if ($value eq '*') { }
1540 0 elsif ($value eq ' ') { }
590 1 13 if (defined $self->{'attached_index_columns'})
596 2 0 if ($old_data[$nf] ne $data[$nf])
637 0 0 unless %olddata
645 0 16 unless my $ret = $self->SUPER::write_record($num, @_)
647 13 3 if ($num > $self->last_record)
649 0 13 unless $self->update_last_record($num)
651 0 16 unless $self->update_last_change
670 11 7 if defined $self->{'updated_today'}
671 7 0 if $y >= 100
672 0 7 unless $self->write_to(1, pack('C3', ($y, $m, $d)))
688 0 2 if (ref $class)
693 2 0 unless (defined $version)
694 0 2 if (defined $options{'memofile'} and $options{'memofile'} =~ /\.fpt$/i) { }
704 0 8 unless (defined $options{$key})
717 0 7 unless defined $name
720 0 7 unless defined $type
725 0 7 unless (defined $length)
726 0 0 if ($type eq 'C') { }
0 0 elsif ($type =~ /^[TD]$/) { }
0 0 elsif ($type =~ /^[NF]$/) { }
731 1 6 if ($type =~ /^[MBGP]$/) { }
1 5 elsif ($type eq 'L') { }
0 5 elsif ($type eq 'Y') { }
735 3 4 unless (defined $decimal)
741 2 5 if ($type eq 'C')
747 1 6 if ($type eq 'M')
749 1 0 if ($version != 48)
776 1 1 if (defined $newname and not $newname =~ /\.dbf$/)
779 0 2 unless $tmp->create_file($newname, 448)
780 0 2 unless $tmp->write_to(0, $header)
784 1 1 if ($needmemo)
787 1 0 unless (defined $dbtname)
789 0 1 if ($version == 48 or $version == 245) { }
790 0 0 unless $dbtname =~ s/\.DBF$/.FPT/
792 1 0 unless $dbtname =~ s/\.DBF$/.DBT/
797 0 1 if $version == 48
798 0 1 unless $dbttmp->create('name', $dbtname, 'version', $memoversion, 'dbf_filename', $basename)
809 1 0 if (ref $self)
810 1 0 if (defined $self->{'memo'})
821 0 0 unless my $ret = $self->SUPER::locksh
822 0 0 if (defined $self->{'memo'})
823 0 0 unless ($self->{'memo'}->locksh)
832 0 0 unless my $ret = $self->SUPER::lockex
833 0 0 if (defined $self->{'memo'})
834 0 0 unless ($self->{'memo'}->lockex)
843 0 0 if defined $self->{'memo'}
855 0 1 unless (my $index = $self->XBase::Index::new($indexfile))
860 0 1 if $XBase::Index::VERBOSE
863 1 0 if (@tags) { }
867 0 5 unless (my $index = $self->XBase::Index::new($indexfile, 'tag', $tag))
881 0 5 if $XBase::Index::VERBOSE
884 1 4 unless defined $self->{'attached_index'}
898 1 1 unless (@_)
907 0 0 if (@_)
914 4 4 if (ref $file eq 'ARRAY')
917 0 4 if (defined $file->[2])
923 6 2 unless (@_)
927 0 8 unless (my $index = 'XBase::Index'->new($file, 'dbf', $self, @tagopts))
929 0 8 unless ($index->prepare_select)
942 110 2 if (defined $recno) { }
947 110 0 if (@result and not $del)
959 0 0 if (@data)
998 1317 0 unless ($del)