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 $Apache2::SSI::SharedMem::Config{'useithreads'} and not $^O =~ /^(?:Android|cygwin|dos|MSWin32|os2|VMS|riscos)/i) { }
84 0 15 if ($@)
100 0 15 $@ ? :
118 0 128 unless $self->SUPER::init(@_)
134 0 0 unless defined $flags
136 0 0 if defined $addr
138 0 0 unless length $id
140 0 0 unless defined $addr
153 0 0 unless defined $addr
155 0 0 unless defined $rv
166 0 2 if (ref $_[0] eq 'HASH') { }
174 2 0 unless length $opts->{'size'}
177 0 2 if (length $opts->{'key'}) { }
196 1 1 if (defined $semid) { }
200 0 1 $found == 1 ? :
205 1 0 if $! =~ /\bNo[[:blank:]]+such[[:blank:]]+file\b/
209 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)
212 0 0 if $semid
214 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'))
222 64 64 !(scalar(@_) % 2) ? :
2 128 &Scalar::Util::reftype($_[0]) eq 'HASH' ? :
228 66 64 unless length $opts->{'create'}
229 130 0 unless length $opts->{'exclusive'}
230 128 2 unless length $opts->{'mode'}
233 65 65 if $opts->{'create'}
235 0 130 if $opts->{'exclusive'}
249 66 23 if (@_)
261 128 64 if (@_)
276 1 5 unless defined $type
277 0 6 if $type & 8
278 0 6 if $self->locked & $type
279 6 0 unless defined $timeout and $timeout =~ /^\d+$/
281 0 6 if $self->locked
291 6 0 if ($rc) { }
301 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)
304 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'))
315 0 140 if @_ % 3
318 0 140 unless length $id
326 0 64 if (ref $_[0] eq 'HASH') { }
334 64 0 unless length $opts->{'size'}
339 0 64 if (length $opts->{'key'}) { }
350 0 64 if ($opts->{'mode'} eq 'w' or $opts->{'key'} =~ s/^>//) { }
0 64 elsif ($opts->{'mode'} eq 'r' or $opts->{'key'} =~ s/^<//) { }
365 64 0 if (defined $id) { }
372 0 0 $flags & IPC_CREAT() ? :
379 0 0 if defined $id
383 0 64 unless (defined $id)
393 0 64 unless (defined $semid)
398 0 0 unless defined $semid
409 0 64 unless (defined $new->op(@{$$SEMOP_ARGS{'LOCK_SH'};}))
417 13 51 if ($there == 1) { }
425 0 51 unless $new->stat(1, 1)
441 0 0 unless length $id
444 0 0 $v ? :
464 0 13 unless length $id
467 0 13 if ($addr) { }
469 0 0 unless &memread($addr, $buffer, 0, $size)
474 0 13 unless shmread $id, $buffer, 0, $size
486 11 2 if ($first_char eq '"' or $first_char eq '{' or $first_char eq '[') { }
495 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)
497 0 0 length $buffer <= 1024 ? :
500 0 0 if (@_) { }
509 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'))
511 11 2 if (@_) { }
515 2 9 if (not ref $data) { }
517 2 0 $size > 0 ? :
535 0 2 if $self->removed
538 0 2 unless length $id
540 0 2 unless length $semid
543 0 2 unless (defined shmctl($id, IPC_RMID(), 0))
549 0 2 unless (defined($rv = semctl($semid, 0, IPC_RMID(), 0)))
553 2 0 $rv ? :
554 2 0 if ($rv)
560 2 0 $rv ? :
575 0 115 unless length $id
576 115 0 if (@_) { }
578 64 51 if (@_ == 1) { }
583 64 0 $v ? :
595 0 0 if (wantarray) { }
598 0 0 unless semctl $id, 0, GETALL(), $data
604 0 0 unless semctl $id, 0, IPC_STAT(), $data
616 12 6 unless $self->locked
618 0 6 unless length $semid
621 5 1 if $type & 4
622 6 0 if (defined $self->op(@{$$SEMOP_ARGS{$type};}))
632 7 0 @_ == 1 ? :
644 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)
647 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'))
649 0 7 if (length $encoded > $size)
656 0 7 if ($addr) { }
658 0 0 unless &memwrite($addr, $encoded, 0, $size)
663 0 7 unless shmwrite $id, $encoded, 0, $size
674 0 128 if (not defined $key or $key eq '') { }
0 128 elsif ($key =~ /^\d+$/) { }
701 10 0 unless $s->destroy
702 0 0 unless $s->owner == $$