Branch Coverage

blib/lib/FFI/Platypus.pm
Criterion Covered Total %
branch 136 160 85.0


line true false branch
37 97 252 if (exists $args{'lib'})
39 2 95 if (not ref $args{'lib'}) { }
95 0 elsif (ref $args{'lib'} eq 'ARRAY') { }
56 0 349 if ($experimental == 1) { }
0 349 elsif ($experimental == 2) { }
65 0 349 if (defined $api and $api > 2 and $experimental != $api)
72 234 115 if ($api == 0) { }
50 65 elsif ($api == 1) { }
65 0 elsif ($api == 2) { }
100 3 346 defined $args{'ignore_not_found'} ? :
111 1 493 $lang =~ /^=(.*)$/ ? :
112 53 441 unless ($class->can("native_type_map"))
118 0 494 unless $class->can("native_type_map")
128 89 12 if (@new)
130 1 88 if (ref $_ eq 'CODE') { }
142 3 63 if (defined $value)
155 352 0 if (defined $value and $value ne $self->{'lang'})
159 1 351 if $class->can("abi")
166 116 236 $self->{'api'} > 0 ? :
171 338 18357 unless $self->{'tp'}->have_type($value)
177 236 116 if $self->{'tp'}->isa("FFI::Platypus::TypeParser::Version0")
181 2 350 if $class->can("load_custom_types")
194 0 275 unless defined $self and defined $name
196 206 69 if defined $alias
198 206 56 if defined $alias
210 0 207 unless $argument_count >= 1
213 0 207 unless defined $alias and ref $cb eq "HASH"
217 0 82 unless defined $cb->{'native_to_perl'} or defined $cb->{'perl_to_native'} or defined $cb->{'perl_to_native_post'}
239 0 13 unless defined $name and defined $alias
242 13 0 if $name =~ /^::/
243 0 13 unless $name =~ /::/
245 3 10 unless ($name->can("ffi_custom_type_api_1"))
250 0 3 if $@
253 0 13 unless ($name->can("ffi_custom_type_api_1"))
268 1 2 unless ref $self and eval { do { $self->isa("FFI::Platypus") } }
276 0 131 unless ref $self and eval { do { $self->isa("FFI::Platypus") } }
291 32 1238 if ref $_[-1] eq "CODE"
293 0 1270 unless @_ >= 3 and @_ <= 6
299 30 1240 if defined $_[0] and ref $_[0] eq "ARRAY"
301 16 1254 unless defined $ret
305 1 1239 if (not defined $var_args and @$fixed_args == 1 and $fixed_args->[0] eq "void")
310 30 1240 defined $var_args ? :
312 0 1524 unless $self->{'tp'}->parse($_)
313 30 1240 if ($var_args)
318 7 120 $type->type_code == 67 ? :
323 151 1119 $name =~ /^-?[0-9]+$/ ? :
324 58 1212 unless defined $address or $self->ignore_not_found
325 5 1207 unless defined $address
326 149 1 @args > 0 ? :
150 1057 if $address == 0
328 32 1174 $wrapper ? :
352 18 862 if ref $_[-1] eq "CODE"
358 2 878 if defined $_[0] and ref $_[0] eq "ARRAY"
362 1 879 unless defined $ret
364 658 222 ref $name ? :
366 0 880 if $perl_name =~ /^-?[0-9]+$/
369 2 878 $varargs ? :
373 875 2 if (defined $function)
385 1 85 unless defined $coderef
386 0 85 unless ref $coderef eq "CODE"
402 4 0 unless $name =~ /::/
403 1 3 if (defined $wrapper and ref $wrapper eq 'CODE') { }
419 201 8 ref $self ? :
428 62 12 ref $self ? :
437 6 6 ref $self ? :
446 6 6 ref $self ? :
456 4 6 if (@_)
469 6 6 ref $self ? :
489 142 1018 unless (defined $self->{'mangler'})
492 2 140 if ($class->can('mangler')) { }
505 2 1189 unless ($handle)
508 1 1 if $self->{'api'} > 0 or $ENV{'FFI_PLATYPUS_DLERROR'}
512 1063 126 if ($address) { }
519 32 94 unless $self->{'handles'}{$path or 0}
528 0 27 if $_[0]{'api'} < 1
536 1 2 if $_[0]{'api'} > 0
552 7 6 unless ($newabi =~ /^[0-9]+$/)
554 1 6 unless (defined $self->abis->{$newabi})
561 1 11 unless (FFI::Platypus::ABI::verify($newabi))
581 0 44 unless $handle