Branch Coverage

blib/lib/Device/Modbus/Response.pm
Criterion Covered Total %
branch 44 46 95.6


line true false branch
48 1 26 unless $args{'function'} or $args{'code'}
50 17 26 if ($args{'function'}) { }
52 1 16 unless exists $Device::Modbus::code_for{$args{'function'}}
57 1 25 unless exists $Device::Modbus::function_for{$args{'code'}}
65 20 103 if $_ eq 'bytes'
69 2 101 unless exists $args{$_}
73 9 30 if ($args{'code'} == 1 or $args{'code'} == 2) { }
10 20 elsif ($args{'code'} == 3 or $args{'code'} == 4 or $args{'code'} == 23) { }
6 14 elsif ($args{'code'} == 5) { }
5 9 elsif ($args{'code'} == 6) { }
4 5 elsif ($args{'code'} == 15) { }
5 0 elsif ($args{'code'} == 16) { }
74 2 7 unless (@{$args{'values'};} > 0 and @{$args{'values'};} <= 2000)
82 3 7 unless (@{$args{'values'};} > 0 and @{$args{'values'};} <= 125)
90 1 5 unless (defined $args{'value'})
98 2 3 unless ($args{'value'} >= 0 and $args{'value'} <= 65535)
106 2 2 unless ($args{'quantity'} > 0 and $args{'quantity'} <= 1968)
114 2 3 unless ($args{'quantity'} >= 1 and $args{'quantity'} <= 123)
128 2 7 if ($self->{'code'} == 1 or $self->{'code'} == 2) { }
2 5 elsif ($self->{'code'} == 3 or $self->{'code'} == 4 or $self->{'code'} == 23) { }
3 2 elsif ($self->{'code'} == 5 or $self->{'code'} == 6) { }
2 0 elsif ($self->{'code'} == 15 or $self->{'code'} == 16) { }
140 1 1 if $self->{'code'} == 5 and $self->{'value'}