Branch Coverage

blib/lib/Apache2/SSI/SharedMem.pm
Criterion Covered Total %
branch 106 248 42.7


line true false branch
38 15 0 if ($Apache2::SSI::SharedMem::Config{'extensions'} =~ /$SUPPORTED_RE/m and not $^O =~ /^(?:Android|cygwin|dos|MSWin32|os2|VMS|riscos)/i) { }
81 0 15 if ($@)
97 0 15 $@ ? :
115 0 128 unless $self->SUPER::init(@_)
131 0 0 unless defined $flags
133 0 0 if defined $addr
135 0 0 unless length $id
137 0 0 unless defined $addr
150 0 0 unless defined $addr
152 0 0 unless defined $rv
163 0 2 if (ref $_[0] eq 'HASH') { }
171 2 0 unless length $opts->{'size'}
174 0 2 if (length $opts->{'key'}) { }
193 1 1 if (defined $semid) { }
197 0 1 $found == 1 ? :
202 1 0 if $! =~ /\bNo[[:blank:]]+such[[:blank:]]+file\b/
206 0 2 if ($Nice::Try::WANTARRAY) { }
2 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 2 length $@ ? :
0 0 if ($Nice::Try::HAS_CATCH)
0 2 if ($Nice::Try::DIED)
209 0 0 if $semid
211 0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 2 $Nice::Try::WANTARRAY ? :
2 0 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
219 64 64 !(scalar(@_) % 2) ? :
2 128 &Scalar::Util::reftype($_[0]) eq 'HASH' ? :
225 66 64 unless length $opts->{'create'}
226 130 0 unless length $opts->{'exclusive'}
227 128 2 unless length $opts->{'mode'}
230 65 65 if $opts->{'create'}
232 0 130 if $opts->{'exclusive'}
246 66 23 if (@_)
258 128 64 if (@_)
273 1 5 unless defined $type
274 0 6 if $type & 8
275 0 6 if $self->locked & $type
276 6 0 unless defined $timeout and $timeout =~ /^\d+$/
278 0 6 if $self->locked
288 6 0 if ($rc) { }
298 0 6 if ($Nice::Try::WANTARRAY) { }
6 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 6 length $@ ? :
0 0 if ($Nice::Try::HAS_CATCH)
0 6 if ($Nice::Try::DIED)
301 0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 0 $Nice::Try::WANTARRAY ? :
0 6 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
312 0 140 if @_ % 3
315 0 140 unless length $id
323 0 64 if (ref $_[0] eq 'HASH') { }
331 64 0 unless length $opts->{'size'}
336 0 64 if (length $opts->{'key'}) { }
347 0 64 if ($opts->{'mode'} eq 'w' or $opts->{'key'} =~ s/^>//) { }
0 64 elsif ($opts->{'mode'} eq 'r' or $opts->{'key'} =~ s/^<//) { }
362 64 0 if (defined $id) { }
369 0 0 $flags & IPC_CREAT() ? :
376 0 0 if defined $id
380 0 64 unless (defined $id)
390 0 64 unless (defined $semid)
395 0 0 unless defined $semid
406 0 64 unless (defined $new->op(@{$$SEMOP_ARGS{'LOCK_SH'};}))
414 13 51 if ($there == 1) { }
422 0 51 unless $new->stat(1, 1)
438 0 0 unless length $id
441 0 0 $v ? :
461 0 13 unless length $id
464 0 13 if ($addr) { }
466 0 0 unless &memread($addr, $buffer, 0, $size)
471 0 13 unless shmread $id, $buffer, 0, $size
483 11 2 if ($first_char eq '"' or $first_char eq '{' or $first_char eq '[') { }
492 0 13 if ($Nice::Try::WANTARRAY) { }
12 1 elsif (defined $Nice::Try::WANTARRAY) { }
0 13 length $@ ? :
0 0 if ($Nice::Try::HAS_CATCH)
0 13 if ($Nice::Try::DIED)
494 0 0 length $buffer <= 1024 ? :
497 0 0 if (@_) { }
506 0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 0 $Nice::Try::WANTARRAY ? :
0 12 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
508 11 2 if (@_) { }
512 2 9 if (not ref $data) { }
514 2 0 $size > 0 ? :
532 0 2 if $self->removed
535 0 2 unless length $id
537 0 2 unless length $semid
540 0 2 unless (defined shmctl($id, IPC_RMID(), 0))
546 0 2 unless (defined($rv = semctl($semid, 0, IPC_RMID(), 0)))
550 2 0 $rv ? :
551 2 0 if ($rv)
557 2 0 $rv ? :
572 0 115 unless length $id
573 115 0 if (@_) { }
575 64 51 if (@_ == 1) { }
580 64 0 $v ? :
592 0 0 if (wantarray) { }
595 0 0 unless semctl $id, 0, GETALL(), $data
601 0 0 unless semctl $id, 0, IPC_STAT(), $data
613 12 6 unless $self->locked
615 0 6 unless length $semid
618 5 1 if $type & 4
619 6 0 if (defined $self->op(@{$$SEMOP_ARGS{$type};}))
629 7 0 @_ == 1 ? :
641 0 7 if ($Nice::Try::WANTARRAY) { }
7 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 7 length $@ ? :
0 0 if ($Nice::Try::HAS_CATCH)
0 7 if ($Nice::Try::DIED)
644 0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 0 $Nice::Try::WANTARRAY ? :
0 7 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
646 0 7 if (length $encoded > $size)
653 0 7 if ($addr) { }
655 0 0 unless &memwrite($addr, $encoded, 0, $size)
660 0 7 unless shmwrite $id, $encoded, 0, $size
671 0 128 if (not defined $key or $key eq '') { }
0 128 elsif ($key =~ /^\d+$/) { }
698 10 0 unless $s->destroy
699 0 0 unless $s->owner == $$