Branch Coverage

lib/Kafka/IO.pm
Criterion Covered Total %
branch 80 170 47.0


line true false branch
252 4 9 if defined $error
279 0 1 unless defined &_STRING($message)
283 0 1 unless $length <= $Kafka::IO::MAX_SOCKET_REQUEST_BYTES
286 1 0 unless defined $timeout
287 0 1 unless $timeout > 0
291 0 1 unless $select
293 0 1 if $self->debug_level >= 2
307 0 1 if $remaining_time <= 0
312 0 1 if ($errno)
313 0 0 if ($errno == 4)
325 1 0 if ($can_write)
327 0 1 if ($retries == 1 and $self->_is_close_wait)
337 1 0 if (defined $wrote and $wrote > 0)
339 0 1 if ($sent < $length)
345 0 1 if ($errno)
346 0 0 if ($errno == 4) { }
0 0 elsif ($errno != 11 and $errno != 11 and not $errno == 104 && $^O eq 'freebsd') { }
362 0 1 unless defined $wrote
366 0 1 unless (not $errno and defined $sent and $sent == $length)
400 0 1 unless $length > 0
403 1 0 unless defined $timeout
404 0 1 unless $timeout > 0
408 0 1 unless $select
422 0 1 if $remaining_time <= 0
427 0 1 if ($errno)
428 0 0 if ($errno == 4)
440 1 0 if ($can_read)
446 1 0 if (defined $from_recv and length $buf)
451 0 1 if ($errno)
452 0 0 if ($errno == 4) { }
0 0 elsif ($errno != 11 and $errno != 11 and not $errno == 104 && $^O eq 'freebsd') { }
468 0 1 if (length $buf == 0)
469 0 0 if (defined $from_recv and not $errno)
471 0 0 if $self->debug_level
475 0 0 if (length $message == 0)
483 0 0 if (my $remaining_attempts = $MAX_RETRIES - $retries)
486 0 0 if ($micro_seconds > 0)
487 0 0 if $micro_seconds > 250000
488 0 0 if $self->debug_level
497 0 1 unless (not $errno and length $message >= $length)
514 0 1 if $self->debug_level >= 2
531 1 0 if ($self->{'socket'})
542 0 1 unless $self->{'socket'} and $self->{'_io_select'}
545 1 0 unless $self->{'_io_select'}->can_read(0)
559 1 2 unless $socket
585 2 10 if ($self->_get_family($name)) { }
588 10 0 if (defined $timeout) { }
592 0 10 if $self->debug_level
612 0 10 if $self->debug_level
615 0 10 if $error
616 2 8 unless $ip
621 0 8 if $self->debug_level
623 2 6 if ($remaining)
624 1 1 if ($remaining - $elapsed > 0) { }
625 0 1 if $self->debug_level
629 0 1 if $self->debug_level
634 0 2 if $self->debug_level
639 0 0 unless $ip
644 0 10 unless socket my $connection, $self->{'pf'}, 1, scalar getprotobyname 'tcp'
650 0 10 unless my $flags = fcntl($connection, 3, 0)
651 0 10 unless fcntl $connection, 4, $flags | 1
653 0 10 unless $flags = fcntl($connection, 3, 0)
654 0 10 unless fcntl $connection, 4, $flags | 2048
659 9 1 $self->{'af'} eq 2 ? :
661 1 9 unless connect $connection, $sockaddr or $!{'EINPROGRESS'}
664 0 9 unless $flags = fcntl($connection, 3, 0)
665 0 9 unless fcntl $connection, 4, $flags & 18446744073709549567
671 0 9 unless (vec $vec, fileno $connection, 1)
679 0 9 if $!
711 0 9 if ($Kafka::IO::Config{'osname'} eq 'netbsd' and _major_osvers() >= 6 and $Kafka::IO::Config{'longsize'} == 4) { }
712 0 0 if (defined $Kafka::IO::Config{'use64bitint'}) { }
718 0 0 $Kafka::IO::Config{'byteorder'} eq '1234' ? :
746 1 7 if (defined $ip_version and $ip_version == $Kafka::IO::IP_V6)
756 0 1 if $err
761 0 1 if $err
770 7 0 if ($is_v4_fqdn and !defined($ip_version) || $ip_version == $Kafka::IO::IP_V4)
771 5 2 if (my $ipaddr = gethostbyname $name)
784 2 11 if ($is_ip = is_ipv6($name) and not $ip_version or $ip_version == $Kafka::IO::IP_V6) { }
3 8 elsif ($is_ip = is_ipv4($name) and not $ip_version or $ip_version == $Kafka::IO::IP_V4) { }
8 0 elsif (not $ip_version) { }
785 1 1 if $ip_version and !$is_ip && is_ipv4($name) || $is_ip && $ip_version == $Kafka::IO::IP_V4
797 0 2 if $ip_version and !$is_ip && is_ipv6($name) || $is_ip && $ip_version == $Kafka::IO::IP_V6
820 0 0 if ($header) { }
821 0 0 unless ($_hdr)
867 0 88 if $self->debug_level