Branch Coverage

lib/Test/Mock/Net/SNMP.pm
Criterion Covered Total %
branch 113 130 86.9


line true false branch
103 1 32 unless defined $lst
227 1 56 unless exists $$self{$method}
228 16 40 if ($method eq 'session') { }
231 1 15 unless exists $$self{$method}{$option}
234 39 1 unless defined $position
235 0 40 unless exists $$self{$method}[$position]{$option}
253 0 4 unless exists $$self{$method}
256 0 4 if $method eq 'session'
275 20 103 if $setting eq 'net_snmp'
358 6 26 if ($$self{'session_failure'}) { }
360 1 5 unless defined $$self{'error'} and $$self{'error'}
366 19 13 if (wantarray) { }
399 6 41 unless (exists $args{'Varbindlist'} or exists $args{-'varbindlist'})
400 6 0 unless $$self{'error'}
413 2 9 if (scalar @{$vbl;} < $sets)
414 2 0 unless $$self{'error'}
420 2 7 if (scalar @{$list;} % $VARBINDLIST_MULTIPLE > 0)
423 2 0 unless $$self{'error'}
428 2 5 unless ($$vbl[0] eq '1.3.6.1.2.1.1.3.0' and $$vbl[$VARBINDLIST_MULTIPLE] eq '1.3.6.1.6.3.1.1.4.1.0')
429 2 0 unless $$self{'error'}
439 30 9 if (defined $$self{'varbindlist'} and @{$$self{'varbindlist'};})
441 29 1 if defined $value
444 8 2 unless $$self{'error'}
452 20 18 if ($cb) { }
457 15 5 if (ref $cb eq 'ARRAY') { }
479 9 58 if $$self{'closed'}
494 1 12 if $self->_closed
497 1 11 unless $self->_process_varbindlist('get_request', %args)
513 1 4 if $self->_closed
516 1 3 unless $self->_process_varbindlist('get_next_request', %args)
532 1 12 if $self->_closed
535 1 11 unless $self->_process_varbindlist('set_request', %args)
537 1 10 if (scalar @{$list;} % $VARBINDLIST_MULTIPLE > 0)
540 1 0 unless $$self{'error'}
559 1 3 if $self->_closed
561 1 2 if (defined $$self{'trap_error'} and $$self{'trap_error'}) { }
580 1 6 if $self->_closed
583 1 5 unless $self->_process_varbindlist('get_bulk_request', %args)
599 1 7 if $self->_closed
601 1 6 unless $self->_process_varbindlist('inform_request', %args)
602 3 3 unless $self->_process_trap_varbindlist('inform_request', %args)
618 1 6 if $self->_closed
620 1 5 unless $self->_process_varbindlist('snmpv2_trap', %args)
621 3 2 unless $self->_process_trap_varbindlist('snmpv2_trap', %args)
623 0 2 if (defined $$self{'trap_error'} and $$self{'trap_error'}) { }
642 1 4 if $self->_closed
644 1 3 unless (exists $args{-'baseoid'} or exists $args{'Baseoid'})
645 1 0 unless $$self{'error'}
664 1 4 if $self->_closed
666 1 3 unless (exists $args{-'columns'} or exists $args{'Columns'})
667 1 0 unless $$self{'error'}
722 1 1 unless defined $$self{'error_status'}
735 1 1 unless defined $$self{'error_index'}
760 4 0 if (@{$$self{'varbindnames'};}) { }
764 0 0 unless $$self{'error'}
778 1 0 if (@{$$self{'varbindtypes'};}) { }
781 0 0 unless $$self{'error'}
796 1 2 if ($option) { }
814 3 2 if ($option) { }
815 1 2 if ($option >= 0 and $option <= $MAX_RETRIES) { }
837 3 2 if ($option) { }
838 1 2 if ($option >= $MIN_MSG_OCTETS and $option <= $MAX_MSG_OCTETS) { }
860 1 2 if ($option)
876 1 2 if ($option) { }
880 1 1 unless defined $$self{'debug'}