Branch Coverage

blib/lib/IO/Socket/INET.pm
Criterion Covered Total %
branch 61 126 48.4


line true false branch
35 5 45 if @_ == 1
49 0 35 unless defined $name
50 35 0 if exists $proto_number{$name}
53 0 0 unless @proto
61 0 35 unless defined $num
62 35 0 if exists $proto_name{$num}
65 0 0 unless @proto
76 7 47 if defined $addr and $addr =~ s[:([\w\(\)/]+)$][]
79 22 32 if (defined $proto and $proto =~ /\D/)
81 0 22 unless (defined $num)
88 11 43 if (defined $port)
89 0 11 $port =~ s/\((\d+)\)$// ? :
92 0 11 if $port =~ /\D/
96 0 11 unless (defined $port)
101 0 11 if @serv and not $proto
116 0 1 $_[0] =~ /^$title/ ? :
117 1 0 if defined fileno $sock
127 0 10 if ($multi and not $addr_str =~ /^\d+(?:\.\d+){3}$/) { }
131 10 0 if defined $h
142 0 35 if exists $arg->{'LocalHost'} and not exists $arg->{'LocalAddr'}
147 0 35 unless ($laddr, $lport, $proto) = _sock_info($arg->{'LocalAddr'}, $arg->{'LocalPort'}, $arg->{'Proto'})
149 22 13 defined $laddr ? :
152 0 35 unless defined $laddr
156 1 34 if exists $arg->{'PeerHost'} and not exists $arg->{'PeerAddr'}
158 19 16 unless (exists $arg->{'Listen'})
161 0 19 unless ($raddr, $rport, $proto) = _sock_info($arg->{'PeerAddr'}, $arg->{'PeerPort'}, $proto)
171 11 24 if (defined $raddr)
173 0 11 unless @raddr
179 0 37 unless $sock->socket(2, $type, $proto)
182 1 36 if (defined $arg->{'Blocking'})
184 0 1 unless defined $sock->blocking($arg->{'Blocking'})
187 0 37 if ($arg->{'Reuse'} or $arg->{'ReuseAddr'})
188 0 0 unless $sock->sockopt(2, 1)
192 0 37 if ($arg->{'ReusePort'})
193 0 0 unless $sock->sockopt(15, 1)
197 0 37 if ($arg->{'Broadcast'})
198 0 0 unless $sock->sockopt(6, 1)
202 23 14 if ($lport or $laddr ne "\0\0\0\0" or exists $arg->{'Listen'})
203 0 23 unless $sock->bind($lport || 0, $laddr)
207 16 21 if (exists $arg->{'Listen'})
208 0 16 unless $sock->listen($arg->{'Listen'} || 5)
214 8 13 unless exists $arg->{'PeerAddr'}
218 0 0 unless $rport or $type == 2 or $type == 3
222 0 13 unless $type == 1 or defined $raddr
224 0 13 unless defined $raddr
231 10 3 if ($sock->connect(pack_sockaddr_in($rport, $raddr)))
236 1 2 unless @raddr
253 0 12 unless @_ == 2 or @_ == 3
256 12 0 @_ == 1 ? :
260 0 23 unless @_ == 2 or @_ == 3
263 0 23 @_ == 1 ? :
267 0 0 unless @_ == 1
270 0 0 $name ? :
274 0 18 unless @_ == 1
277 18 0 $name ? :
281 0 0 unless @_ == 1
284 0 0 $addr ? :
288 0 0 unless @_ == 1
291 0 0 $name ? :
295 0 0 unless @_ == 1
298 0 0 $name ? :
302 0 0 unless @_ == 1
305 0 0 $addr ? :