Branch Coverage

blib/lib/FusionInventory/Agent/SNMP/Mock.pm
Criterion Covered Total %
branch 27 52 51.9


line true false branch
42 4 13 if ($params{'file'})
44 0 4 unless -f $params{'file'}
46 0 4 unless -r $params{'file'}
52 13 0 if ($params{'hash'})
64 0 0 unless $self->{'oldvalues'}
67 0 0 if (-r $file and -f $file) { }
91 0 4 unless $first_line =~ /^(\S+) = .*/
93 0 4 substr($first_line, 0, 1) eq '.' ? :
107 0 0 if ($line =~ /^ (\S+) \s = \s (?:Wrong \s Type \s \(should \s be \s [^:]+\): \s)? ([^:]+): \s (.*) /x)
122 0 0 if (not $line =~ /^$/ || $line =~ /= ""$/ and $last_oid)
123 0 0 if ($values->{$last_oid}[0] eq 'STRING' and not $values->{$last_oid}[1] =~ /"$/)
130 0 0 if ($values->{$last_oid}[0] eq 'Hex-STRING')
150 32 9 if ($line =~ /^ ([^.]+) \. ([\d.]+) \s = \s (?:Wrong \s Type \s \(should \s be \s [^:]+\): \s)? ([^:]+): \s (.*) /x)
160 31 1 if ($prefixes{$mib}) { }
173 5 4 if (not $line =~ /^$/ || $line =~ /= ""$/ and $last_oid)
174 2 3 if ($values->{$last_oid}[0] eq 'STRING' and not $values->{$last_oid}[1] =~ /"$/)
181 0 3 if ($values->{$last_oid}[0] eq 'Hex-STRING' and $line =~ /^([A-F0-9]{2})( [A-F0-9]{2})?/)
199 0 110 unless $oid
200 95 15 unless $self->{'values'}{$oid}
211 0 69 unless $oid
215 153 42 unless $key =~ /^$oid\.(.+)/
228 1 56 if ($format eq 'Hex-STRING') { }
26 30 elsif ($format eq 'STRING') { }
0 30 elsif ($format eq 'OID') { }
235 0 0 if ($value =~ /^ ([^.]+) (\.[\d.]+)? $/x)
239 0 0 $prefixes{$prefix} ? :