Branch Coverage

blib/lib/Net/SIP/SDP.pm
Criterion Covered Total %
branch 69 132 52.2


line true false branch
28 52 48 if @_ > 1
30 48 0 !ref($data) || UNIVERSAL::isa($data, 'ARRAY') ? :
53 0 52 if $g{'r'}
56 52 0 if ($g_addr and not $g{'c'})
57 52 0 ip_is_v4($g_addr) ? :
60 52 0 unless $g{'t'}
79 52 0 unless ($o)
93 416 104 unless defined $v
94 0 104 ref $v ? :
100 0 52 if %g
111 0 52 if (my $mline = delete $m{'m'}) { }
116 0 156 unless defined($m_self{$_} = delete $m{$_})
122 0 52 unless defined(my $fmt = $m_self{'fmt'} = delete $m{'fmt'})
128 52 0 if (not $m{'c'}) { }
129 0 52 if (my $addr = delete $m{'addr'}) { }
52 0 elsif ($g_addr) { }
131 0 0 if $addr ne $g_addr
144 208 52 unless defined $v
145 52 0 ref $v ? :
150 0 52 if %m
170 0 48 if ref $string and ref $string ne 'ARRAY'
172 0 48 ref $string ? :
178 0 384 unless my($key, $val) = $l =~ /^([a-z])=(.*)/
212 0 48 unless $line->[0] eq 'v'
213 0 48 unless $line->[1] eq '0'
219 0 48 unless $line->[0] eq 'o'
229 48 144 if $line->[0] eq 'm'
232 48 96 if ($line->[0] eq 'c')
234 0 48 if $have_c++
244 0 48 unless $line->[0] eq 'm'
266 0 96 if $line->[0] eq 'm'
269 0 96 if ($line->[0] eq 'c')
271 0 0 if $have_c++
292 74 0 if (my $media = $self->{'media'})
323 64 0 wantarray ? :
336 0 12 unless defined $index
338 12 0 unless (&looks_like_number($index))
340 0 12 unless my(@i) = grep({$m->[$_]{'media'} eq $index;} 0 .. $#$m)
343 0 12 unless $m = $m->[$index]
345 12 18 unless $l->[0] eq 'a'
346 6 12 unless $l->[1] =~ /^rtpmap:(\d+)\s+(\S+)/
347 6 6 if $2 eq $name
365 1 0 if (@replace == 1)
367 0 1 if ref $replace[0][0]
371 0 1 if @replace != @$media
377 1 0 if ($g_addr)
386 1 0 if ($h and keys %$h == 1) { }
389 1 0 if ($g_addr ne $new_addr)
394 1 3 if ($line->[0] eq 'c')
423 0 1 if ($r->[1] != $m->{'port'})
428 0 0 unless $line->[0] eq 'm'
431 0 0 if ($r->[1]) { }
441 1 0 if ($r->[0] ne $m->{'addr'})
445 0 3 if ($line->[0] eq 'c')
451 0 1 if (not $have_c and !$g_addr || $r->[0] ne $g_addr)
467 0 48 unless $ntyp eq 'IN'
468 48 0 if ($atyp eq 'IP4') { }
0 0 elsif ($atyp eq 'IP6') { }
469 0 48 unless ip_is_v4($addr)
471 0 0 unless ip_is_v6($addr)
479 0 1 $addr =~ /:/ ? :
489 0 48 unless my($media, $port, $range, $proto, $fmt) = $mline =~ m[^(\w+)\s+(\d+)(?:/(\d+))?\s+(\S+)((?:\s+\S+)+)]
493 48 0 if $proto =~ m[^RTP/]
499 52 0 if @fmt == 1 and ref $fmt[0]
500 52 0 if $proto =~ m[^RTP/]
501 0 52 if $range > 1