Branch Coverage

blib/lib/Device/Modbus/Request.pm
Criterion Covered Total %
branch 52 54 96.3


line true false branch
47 1 34 unless $args{'function'} or $args{'code'}
49 47 34 if ($args{'function'}) { }
51 1 46 unless exists $Device::Modbus::code_for{$args{'function'}}
56 1 33 unless exists $Device::Modbus::function_for{$args{'code'}}
63 39 275 if $_ eq 'bytes' or $_ eq 'write_quantity'
64 17 33 if $_ eq 'quantity' and $args{'code'} == 15 || $args{'code'} == 16
68 1 257 unless exists $args{$_}
73 16 62 if ($args{'code'} == 1 or $args{'code'} == 2) { }
17 45 elsif ($args{'code'} == 3 or $args{'code'} == 4) { }
10 35 elsif ($args{'code'} == 5) { }
7 28 elsif ($args{'code'} == 6) { }
9 19 elsif ($args{'code'} == 15) { }
8 11 elsif ($args{'code'} == 16) { }
11 0 elsif ($args{'code'} == 23) { }
74 6 10 unless (defined $args{'quantity'} and $args{'quantity'} >= 1 and $args{'quantity'} <= 2000)
82 6 11 unless (defined $args{'quantity'} and $args{'quantity'} >= 1 and $args{'quantity'} <= 125)
91 6 4 $args{'value'} ? :
94 2 5 unless (defined $args{'value'} and $args{'value'} >= 0 and $args{'value'} <= 65535)
102 4 5 unless (defined $args{'values'} and @{$args{'values'};} >= 1 and @{$args{'values'};} <= 1968)
110 4 4 unless (defined $args{'values'} and @{$args{'values'};} >= 1 and @{$args{'values'};} <= 123)
118 3 4 unless (defined $args{'read_quantity'} and defined $args{'values'} and $args{'read_quantity'} >= 1 and $args{'read_quantity'} <= 125 and @{$args{'values'};} >= 1 and @{$args{'values'};} <= 121)
139 8 14 if ($self->{'code'} == 1 or $self->{'code'} == 2 or $self->{'code'} == 3 or $self->{'code'} == 4) { }
8 6 elsif ($self->{'code'} == 5 or $self->{'code'} == 6) { }
2 4 elsif ($self->{'code'} == 15) { }
2 2 elsif ($self->{'code'} == 16) { }
2 0 elsif ($self->{'code'} == 23) { }
145 3 3 if $self->{'code'} == 5 and $self->{'value'}