Branch Coverage

blib/lib/Forks/Queue/SQLite.pm
Criterion Covered Total %
branch 175 286 61.1


line true false branch
26 0 38 if ($opts{'join'} and not $opts{'db_file'})
29 0 38 if ($opts{'file'} and not $opts{'db_file'})
39 2 36 if (not $opts{'join'} and -f $opts{'db_file'})
50 36 2 if (not $exists) { }
56 0 36 if $_DEBUG
60 0 36 if ($z1 and not $z2)
66 0 0 if $_DEBUG
68 0 36 unless (eval { do { $self->_init } })
73 0 2 if $_DEBUG
76 5 33 if (defined $list)
77 5 0 if (ref $list eq 'ARRAY') { }
93 24378 0 if $] >= 5.014
97 1 0 if --$count <= 0
100 0 0 if $DEBUG
114 0 36 unless ($z1)
120 0 36 unless ($z2)
127 0 36 unless ($z3)
133 0 36 unless ($z4)
146 0 28268 $INC{'threads.pm'} ? :
151 28055 12 if ($self->{'_dbh'} and $$ == $self->{'_pid'}[0] and $tid == $self->{'_pid'}[1])
154 0 14 if (&Forks::Queue::__inGD())
163 12 2 unless ($self->{'_DESTROY'})
184 0 34 if (&Forks::Queue::__inGD()) { }
185 0 0 unless eval { do { $dbh = $self->_dbh; 1 } }
189 34 0 $self->{'_pid'} ? :
211 34 0 if $dbh
212 23 11 if ($t and $t->[0] and $t->[0][0] == 0) { }
213 0 23 if $_DEBUG
214 22 1 if (not $self->{'persist'})
226 0 0 if not $dbh and $self->{'_DESTROY'}
227 22197 208 if (@_ == 1) { }
208 0 elsif (@_ == 2) { }
229 0 0 if (not $sth and $self->{'_DESTROY'})
237 0 22197 unless ($z)
242 22126 71 if (@$t == 0)
266 0 8 if ($end)
271 8 0 unless ($end)
296 0 82 if $XDEBUG
302 0 4 if $XDEBUG
316 4 32 unless ($self->{'_limit_magic'})
318 0 4 if $XDEBUG
320 10 26 if (@_) { }
322 0 10 if $XDEBUG
324 6 4 if (@_)
325 0 6 if $XDEBUG
331 0 26 if $XDEBUG
355 0 3660 unless $dbh
357 0 3660 unless $sth
380 0 2 if ($self->_end)
387 0 2 if $self->{'limit'} <= 0
395 2 0 if (@items and $self->_avail < $limit)
403 0 2 if (@items > 0)
407 2 0 if $pushed
409 0 2 if ($failed_items)
410 0 0 if ($self->{'on_limit'} eq 'fail') { }
414 0 0 if $_DEBUG
417 0 0 if $_DEBUG
447 2 146 if ($self->_end)
454 109 37 if $self->{'limit'} <= 0
468 21 125 if (@items > 0)
472 143 3 if $pushed
474 21 125 if ($failed_items)
475 13 8 if ($self->{'on_limit'} eq 'fail') { }
479 0 8 if $_DEBUG
482 0 8 if $_DEBUG
494 2114 7 unless $ready
501 0 8 if ($self->{'limit'} <= 0)
505 0 8 @_ ? :
507 8 8 if $self->_avail + $count <= $self->{'limit'}
508 0 8 if $self->_end
520 0 148 if (@$tt == 0) { }
529 8 0 if @_
531 0 3 if ($self->limit > 0 and $count > $self->limit)
534 3 0 if ($self->{'style'} ne 'lifo') { }
535 3 0 @_ ? :
538 0 0 @_ ? :
546 21 16 @_ ? :
551 4 5 if @_
554 4 5 @_ ? :
560 0 1 @_ ? :
566 0 2 @_ ? :
568 0 2 @_ ? :
574 24 2 if @_
576 13 10 if @_
581 9 9 if ($self->{'style'} eq 'lifo')
585 0 18 if ($count <= 0)
589 8 10 if ($index < 0)
590 0 8 if ($index + $count > 0)
601 9 9 if ($reverse)
604 8 10 @_ ? :
613 0 10 if ($self->_end)
620 0 10 if $self->{'limit'} <= 0
622 2 8 if ($pos >= $self->_avail)
623 0 2 if ($self->{'on_limit'} eq 'tq-compat') { }
633 2 6 if ($pos <= -$self->_avail)
637 2 6 if ($pos < 0)
653 8 0 if (@$tt > 0) { }
660 0 8 if (@$tt == $pos) { }
2 6 elsif ($pos == 0) { }
664 0 0 if ($t2 < 0) { }
678 6 2 if ($t1 == $t2) { }
687 0 2 if ($t3 == $t1)
691 0 8 if ($self->{'on_limit'} eq 'tq-compat') { }
707 2 6 if (@items > 0)
710 2 6 if (@deferred_items)
711 2 0 if ($self->{'on_limit'} eq 'fail') { }
715 0 0 if $_DEBUG
718 0 0 if $_DEBUG
722 8 0 if $inserted
739 51 66 @_ ? :
740 0 117 if $hi <= $lo
749 0 117 if ($lo > 0 and $block)
754 42 75 $tfactor > 0 ? :
763 0 117 unless ($sths)
768 0 19936 $lo < 0 ? :
772 0 19936 if ($lo < 0 and -$lo > @$tt)
776 14 19922 if (not $tt or @$tt == 0) { }
19812 110 elsif ($block > 1 and $lo == 0 and @$tt < $hi) { }
6 104 elsif (@$tt <= $lo) { }
778 7 7 if ($block) { }
793 12 92 if $hi > @$tt
796 0 443 unless (defined $tt->[$itt])
801 399 44 if ($purge)
804 0 399 unless ($zd)
812 19864 59 if ($block)
813 29 19835 if ($self->_end or $self->_expired)
818 45 59 @_ ? :
833 0 0 if ($tfactor > 0)
846 0 0 if (@$tt == 0)
847 0 0 if ($block and $self->_wait_for_item) { }
856 0 0 if ($purge)
859 0 0 unless ($zd)
866 0 0 $wantarray ? :
881 10 25 if ($index < 0)
892 5 22 if ($index < 0)
900 0 161 unless $Forks::Queue::NOTIFY_OK
908 64 97 if (@pids)
909 0 64 if $self->{'debug'} // $DEBUG
912 161 85 if $_->[0] == $$
913 0 161 if (@tids)
916 0 0 if $thr
928 0 17 if ($^O eq 'MSWin32') { }
937 17 0 if (defined $candidate and $candidate ne '' and -d $candidate and -w _ and -x _)