Branch Coverage

blib/lib/IPC/Shareable.pm
Criterion Covered Total %
branch 31 308 10.0


line true false branch
129 0 0 unless (exists $global_register{$knot->seg->id})
133 0 0 unless $knot->{'_lock'}
135 0 0 if ($knot->{'_type'} eq 'HASH') { }
0 0 elsif ($knot->{'_type'} eq 'ARRAY') { }
0 0 elsif ($knot->{'_type'} eq 'SCALAR') { }
137 0 0 if $knot->_need_tie($val, $key)
142 0 0 if $knot->_need_tie($val, $i)
147 0 0 if $knot->_need_tie($val)
154 0 0 if ($knot->{'_lock'} & 2) { }
157 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
167 0 0 unless (exists $global_register{$knot->seg->id})
172 0 0 if ($knot->{'_lock'} or $knot->{'_iterating'}) { }
182 0 0 if ($knot->{'_type'} eq 'HASH') { }
0 0 elsif ($knot->{'_type'} eq 'ARRAY') { }
0 0 elsif ($knot->{'_type'} eq 'SCALAR') { }
183 0 0 if (defined $data) { }
191 0 0 if (defined $data) { }
199 0 0 if (defined $data) { }
209 0 0 if (my $inner = _is_kid($val))
219 0 0 if ($knot->{'_type'} eq 'HASH') { }
0 0 elsif ($knot->{'_type'} eq 'ARRAY') { }
230 0 0 if ($knot->{'_lock'} & 2) { }
233 0 0 if (not defined $knot->_encode($knot->seg, $knot->{'_data'}))
242 0 0 unless $knot->{'_lock'}
244 0 0 if ($knot->{'_lock'} & 2) { }
247 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
258 0 0 unless $knot->{'_lock'}
265 0 0 unless $knot->{'_lock'}
275 0 0 if (not defined $next) { }
289 0 0 unless (exists $global_register{$knot->seg->id})
293 0 0 unless $knot->{'_lock'}
296 0 0 if ($knot->{'_lock'} & 2) { }
299 0 0 if (not defined $knot->_encode($knot->seg, $knot->{'_data'}))
307 0 0 unless $knot->{'_lock'}
310 0 0 if ($knot->{'_lock'} & 2) { }
313 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
322 0 0 unless $knot->{'_lock'}
324 0 0 if ($knot->{'_lock'} & 2) { }
327 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
336 0 0 unless $knot->{'_lock'}
338 0 0 if ($knot->{'_lock'} & 2) { }
341 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
350 0 0 unless $knot->{'_lock'}
352 0 0 if ($knot->{'_lock'} & 2) { }
355 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
364 0 0 unless $knot->{'_lock'}
371 0 0 unless $knot->{'_lock'}
373 0 0 if ($knot->{'_lock'} & 2) { }
376 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
390 0 0 if ($type eq "HASH")
394 0 0 if ($type eq "ARRAY")
398 0 0 if ($type eq "SCALAR")
410 0 0 if (not $warning =~ /hash after insertion/)
428 19 0 if (defined $attr) { }
443 0 0 unless defined $opts{'key'}
445 0 0 unless defined $opts{'mode'}
458 0 0 if $pid
460 0 0 if (not $pid)
473 0 0 unless defined $h{'__ipc'}
474 0 0 unless $h{'__ipc'}{'run'}
477 0 0 if $opts{'destroy'}
499 0 0 if $destroy
503 0 0 unless defined $flags
505 0 0 if $flags & 8
507 0 0 if $knot->{'_lock'} & $flags
510 0 0 if $knot->{'_lock'}
514 0 0 if ($return_val)
523 2 0 unless $knot->{'_lock'}
524 0 0 if ($knot->{'_was_changed'})
525 0 0 unless (defined $knot->_encode($knot->seg, $knot->{'_data'}))
532 0 0 if $flags & 4
547 0 0 unless $s->attributes("owner") == $$
548 0 0 if $s->attributes("protected")
561 0 0 if $s->attributes("protected")
568 0 0 if (scalar @_ == 2)
571 0 0 if (scalar @_ == 1)
575 0 0 unless (defined $protect_key)
579 0 0 unless ($protect_key =~ /^\d+$/)
587 0 0 if ($stored_key and $stored_key == $protect_key)
598 0 1 unless $s->remove
602 0 1 unless $s->remove
609 7 0 if defined $knot->{'_shm'}
613 1 0 if defined $knot->{'_sem'}
618 0 0 unless (defined $glue)
622 0 0 unless defined $warn
647 0 0 if ($serializer eq 'storable') { }
0 0 elsif ($serializer eq 'json') { }
659 0 2 if $s->attributes("protected")
660 1 1 unless $s->attributes("destroy")
661 0 1 if $s->attributes("owner") != $$
670 0 0 if ($serializer eq 'storable') { }
0 0 elsif ($serializer eq 'json') { }
685 0 0 if (length $json > $seg->size)
695 0 0 unless $json
705 0 0 unless (defined $data)
721 0 0 if (length $ice > $seg->size)
731 0 2 unless $ice
735 0 2 if ($tag eq 'IPC::Shareable') { }
737 0 0 unless (defined $water)
748 0 2 if (scalar @_ == 4) { }
764 0 2 if ($knot->attributes("limit") and $shm_size > 1073741824)
772 0 2 if ($knot->attributes('graceful')) { }
778 0 0 unless (defined $exclusive)
779 0 0 if ($knot->attributes("warn"))
789 0 2 unless (defined $seg)
790 0 0 if ($! =~ /Cannot allocate memory/)
795 0 0 if ($! =~ /No space left on device/)
800 0 0 if (not $knot->attributes('create')) { }
0 0 elsif ($knot->attributes('create') and $knot->attributes('exclusive')) { }
816 0 2 unless (defined $sem)
820 0 2 unless ($sem->op(@{$semop_args{1};}))
837 2 0 if ($sem->getval(0) != 1)
839 2 0 unless (exists $global_register{$knot->seg->id})
844 0 2 unless ($sem->setval(0, 1))
856 1 1 defined $opts ? :
859 10 14 if (not defined $opts->{$k}) { }
0 14 elsif ($opts->{$k} eq 'no') { }
863 0 0 if ($^W)
885 2 0 if ($key_str eq '') { }
0 0 elsif ($key_str =~ /^\d+$/) { }
897 0 2 if ($key > 2147483648)
900 0 0 if ($key == 0)
923 0 0 if $used_ids{$key}
936 0 0 if ($shm_slot_available)
938 0 0 if $seg
942 0 0 unless ($verified_exclusive)
962 1 1 if $knot->attributes("create")
963 0 2 if $knot->attributes("exclusive")
973 0 0 if ($parent->{'_key'} == IPC_PRIVATE()) { }
993 0 0 if ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'SCALAR') { }
996 0 0 unless $child
998 0 0 if $opts{'tidy'}
1005 0 0 unless $child
1007 0 0 if $opts{'tidy'}
1014 0 0 unless $child
1025 0 0 unless my $data = shift()
1028 0 0 unless $type
1032 0 0 if ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'SCALAR') { }
1042 0 0 if (ref $obj eq "IPC::Shareable")
1052 0 0 unless $type
1056 0 0 if ($type eq 'HASH') { }
0 0 elsif ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'SCALAR') { }
1066 0 0 $need_tie ? :
1073 0 0 if ($parent_type eq 'HASH') { }
0 0 elsif ($parent_type eq 'ARRAY') { }
1075 0 0 if (exists $data->{$id} and keys %{$$data{$id};} and tied %{$$data{$id};})
1081 0 0 if (exists $data->[$id] and tied @{$$data[$id];})
1095 0 0 if (ref $_ eq 'IPC::Shareable') { }
1111 0 0 if (ref $_ eq 'IPC::Shareable') { }