Branch Coverage

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


line true false branch
298 0 1 unless (exists $args{'connection'} and $args{'connection'}->isa('Net::XMPP::Connection'))
340 0 2 if ref $jid and $jid->isa('Net::XMPP::JID')
344 1 1 if (exists $item{'groups'})
367 0 2 if ref $jid and $jid->isa('Net::XMPP::JID')
370 1 1 unless defined $priority
375 2 0 unless exists $$self{'JIDS'}{$jid}{'priorities'}{$priority}
379 0 0 if $$self{'JIDS'}{$jid}{'priorities'}{$priority}[$index]{'resource'} eq $resource
382 2 0 if $loc == -1
385 1 1 if exists $item{'status'}
387 1 1 if exists $item{'show'}
421 0 68 if ref $jid and $jid->isa('Net::XMPP::JID')
423 4 64 unless exists $$self{'JIDS'}
424 2 62 unless exists $$self{'JIDS'}{$jid}
450 4 4 unless exists $$self{'GROUPS'}
451 0 4 unless exists $$self{'GROUPS'}{$group}
465 0 0 unless exists $$self{'GROUPS'}
466 0 0 if scalar keys %{$$self{'GROUPS'};} == 0
482 0 0 if $packet->GetTag eq 'iq'
483 0 0 if $packet->GetTag eq 'presence'
501 0 0 unless $type eq 'set' or $type eq 'result'
518 0 0 if ($$roster{$jid}{'subscription'} ne 'remove')
539 0 0 unless defined $type
540 0 0 unless $type eq '' or $type eq 'available' or $type eq 'unavailable'
547 0 0 unless $resource ne ''
550 0 0 unless defined $jid
552 0 0 unless $self->exists($jid)
561 0 0 if ($type eq '' or $type eq 'available')
566 0 0 unless defined $item{'priority'}
569 0 0 unless defined $item{'show'}
572 0 0 unless defined $item{'status'}
590 1 7 unless defined $type
594 6 2 if ($type eq 'all' or $type eq 'nogroup')
596 1 5 unless exists $$self{'JIDS'}
601 1 1 if $type eq 'nogroup' and exists $$self{'JIDS'}{$jid}{'groups'} and $#{$$self{'JIDS'}{$jid}{'groups'};} > -1
607 2 5 if ($type eq 'group')
609 0 2 unless exists $$self{'GROUPS'}
610 2 0 if (defined $group and $self->groupExists($group))
633 0 12 if ref $jid and $jid->isa('Net::XMPP::JID')
635 0 12 unless $self->exists($jid)
655 0 6 if ref $jid and $jid->isa('Net::XMPP::JID')
657 2 4 if (defined $resource)
659 0 2 unless $self->resourceExists($jid, $resource)
660 0 2 unless exists $$self{'JIDS'}{$jid}{'resources'}{$resource}{'priority'}
664 0 4 unless exists $$self{'JIDS'}{$jid}{'priorities'}
681 0 9 if ref $jid and $jid->isa('Net::XMPP::JID')
683 0 9 unless $self->exists($jid)
684 7 2 if (defined $key)
686 2 5 unless exists $$self{'JIDS'}{$jid}{$key}
703 1 1 if ref $jid and $jid->isa('Net::XMPP::JID')
705 2 0 if ($self->exists($jid))
709 1 1 if (defined $self->query($jid, 'groups'))
715 2 0 if scalar keys %{$$self{'GROUPS'}{$group};} == 0
717 1 1 if scalar keys %{$$self{'GROUPS'};} == 0
722 1 1 if scalar keys %{$$self{'JIDS'};} == 0
738 0 2 if ref $jid and $jid->isa('Net::XMPP::JID')
740 2 0 if ($self->resourceExists($jid, $resource))
745 0 2 unless defined $oldPriority
747 2 0 if (exists $$self{'JIDS'}{$jid}{'priorities'}{$oldPriority})
752 2 0 if $$self{'JIDS'}{$jid}{'priorities'}{$oldPriority}[$index]{'resource'} eq $resource
760 2 0 if exists $$self{'JIDS'}{$jid}{'priorities'}{$oldPriority} and $#{$$self{'JIDS'}{$jid}{'priorities'}{$oldPriority};} == -1
779 0 4 if ref $jid and $jid->isa('Net::XMPP::JID')
781 0 4 unless $self->exists($jid)
785 1 3 unless defined $priority
802 0 12 if ref $jid and $jid->isa('Net::XMPP::JID')
804 0 12 unless $self->exists($jid)
805 0 12 unless exists $$self{'JIDS'}{$jid}{'resources'}
806 0 12 unless exists $$self{'JIDS'}{$jid}{'resources'}{$resource}
823 0 7 if ref $jid and $jid->isa('Net::XMPP::JID')
825 0 7 unless $self->resourceExists($jid, $resource)
826 4 3 if (defined $key)
828 1 3 unless exists $$self{'JIDS'}{$jid}{'resources'}{$resource}{$key}
845 0 16 if ref $jid and $jid->isa('Net::XMPP::JID')
847 0 16 unless $self->exists($jid)
855 0 9 if $$self{'JIDS'}{$jid}{'priorities'}{$priority}[$index]{'resource'} eq ' '
878 0 1 if ref $jid and $jid->isa('Net::XMPP::JID')
880 0 1 unless defined $key
881 0 1 unless defined $value
882 0 1 unless $self->resourceExists($jid, $resource)
902 0 1 if ref $jid and $jid->isa('Net::XMPP::JID')
904 0 1 unless defined $key
905 0 1 unless defined $value
906 0 1 unless $self->exists($jid)