Branch Coverage

blib/lib/Net/XMPP3/Roster.pm
Criterion Covered Total %
branch 88 164 53.6


line true false branch
231 0 1 unless (exists $args{'connection'} and $args{'connection'}->isa('Net::XMPP3::Connection'))
271 0 2 if $jid->isa('Net::XMPP3::JID')
275 1 1 if (exists $item{'groups'})
298 0 2 if $jid->isa('Net::XMPP3::JID')
301 1 1 unless defined $priority
306 2 0 unless exists $$self{'JIDS'}{$jid}{'priorities'}{$priority}
310 0 0 if $$self{'JIDS'}{$jid}{'priorities'}{$priority}[$index]{'resource'} eq $resource
313 2 0 if $loc == -1
316 1 1 if exists $item{'status'}
318 1 1 if exists $item{'show'}
352 0 68 if $jid->isa('Net::XMPP3::JID')
354 4 64 unless exists $$self{'JIDS'}
355 2 62 unless exists $$self{'JIDS'}{$jid}
381 4 4 unless exists $$self{'GROUPS'}
382 0 4 unless exists $$self{'GROUPS'}{$group}
396 0 0 unless exists $$self{'GROUPS'}
397 0 0 if scalar keys %{$$self{'GROUPS'};} == 0
413 0 0 if $packet->GetTag eq 'iq'
414 0 0 if $packet->GetTag eq 'presence'
432 0 0 unless $type eq 'set' or $type eq 'result'
449 0 0 if ($$roster{$jid}{'subscription'} ne 'remove')
470 0 0 unless defined $type
471 0 0 unless $type eq '' or $type eq 'available' or $type eq 'unavailable'
478 0 0 unless $resource ne ''
481 0 0 unless defined $jid
483 0 0 unless $self->exists($jid)
492 0 0 if ($type eq '' or $type eq 'available')
497 0 0 unless defined $item{'priority'}
500 0 0 unless defined $item{'show'}
503 0 0 unless defined $item{'status'}
521 1 7 unless defined $type
525 6 2 if ($type eq 'all' or $type eq 'nogroup')
527 1 5 unless exists $$self{'JIDS'}
532 1 1 if $type eq 'nogroup' and exists $$self{'JIDS'}{$jid}{'groups'} and $#{$$self{'JIDS'}{$jid}{'groups'};} > -1
538 2 5 if ($type eq 'group')
540 0 2 unless exists $$self{'GROUPS'}
541 2 0 if (defined $group and $self->groupExists($group))
564 0 12 if $jid->isa('Net::XMPP3::JID')
566 0 12 unless $self->exists($jid)
586 0 6 if $jid->isa('Net::XMPP3::JID')
588 2 4 if (defined $resource)
590 0 2 unless $self->resourceExists($jid, $resource)
591 0 2 unless exists $$self{'JIDS'}{$jid}{'resources'}{$resource}{'priority'}
595 0 4 unless exists $$self{'JIDS'}{$jid}{'priorities'}
612 0 9 if $jid->isa('Net::XMPP3::JID')
614 0 9 unless $self->exists($jid)
615 7 2 if (defined $key)
617 2 5 unless exists $$self{'JIDS'}{$jid}{$key}
634 1 1 if $jid->isa('Net::XMPP3::JID')
636 2 0 if ($self->exists($jid))
640 1 1 if (defined $self->query($jid, 'groups'))
646 2 0 if scalar keys %{$$self{'GROUPS'}{$group};} == 0
648 1 1 if scalar keys %{$$self{'GROUPS'};} == 0
653 1 1 if scalar keys %{$$self{'JIDS'};} == 0
669 0 2 if $jid->isa('Net::XMPP3::JID')
671 2 0 if ($self->resourceExists($jid, $resource))
676 0 2 unless defined $oldPriority
678 2 0 if (exists $$self{'JIDS'}{$jid}{'priorities'}{$oldPriority})
683 2 0 if $$self{'JIDS'}{$jid}{'priorities'}{$oldPriority}[$index]{'resource'} eq $resource
691 2 0 if exists $$self{'JIDS'}{$jid}{'priorities'}{$oldPriority} and $#{$$self{'JIDS'}{$jid}{'priorities'}{$oldPriority};} == -1
710 0 4 if $jid->isa('Net::XMPP3::JID')
712 0 4 unless $self->exists($jid)
716 1 3 unless defined $priority
733 0 12 if $jid->isa('Net::XMPP3::JID')
735 0 12 unless $self->exists($jid)
736 0 12 unless exists $$self{'JIDS'}{$jid}{'resources'}
737 0 12 unless exists $$self{'JIDS'}{$jid}{'resources'}{$resource}
754 0 7 if $jid->isa('Net::XMPP3::JID')
756 0 7 unless $self->resourceExists($jid, $resource)
757 4 3 if (defined $key)
759 1 3 unless exists $$self{'JIDS'}{$jid}{'resources'}{$resource}{$key}
776 0 16 if $jid->isa('Net::XMPP3::JID')
778 0 16 unless $self->exists($jid)
786 0 9 if $$self{'JIDS'}{$jid}{'priorities'}{$priority}[$index]{'resource'} eq ' '
809 0 1 if $jid->isa('Net::XMPP3::JID')
811 0 1 unless defined $key
812 0 1 unless defined $value
813 0 1 unless $self->resourceExists($jid, $resource)
833 0 1 if $jid->isa('Net::XMPP3::JID')
835 0 1 unless defined $key
836 0 1 unless defined $value
837 0 1 unless $self->exists($jid)