Branch Coverage

blib/lib/BACnet/DataTypes/Utils.pm
Criterion Covered Total %
branch 82 112 73.2


line true false branch
86 0 0 if ($bool_in != 0 and $bool_in != 1)
96 2 5 if ($bool_in != 0 and $bool_in != 1)
108 10 37 if ($input_int < 0) { }
122 8 64 unless (defined $input_int)
147 140 40 if ($input_int == 0)
152 3 137 if (defined $sign_wrap and (unpack("C", $encoded[-1]) & 128) == 128)
179 10 6 if ($to_encode == 0)
184 4 6 if (defined $sign_wrap and (unpack("C", $encoded[-1]) & 128) == 0)
200 10 46 if (($first_octet & 128) == 128) { }
212 8 73 if ($coded_int eq pack("C", $undef_identifier))
263 0 0 if ($string ne "")
296 0 1466 unless (defined $bytes[$len - 1])
300 34 1432 if (_is_tag_extended($bytes[$len - 1]))
304 589 877 if (($bytes[0] & 7) == 5)
307 0 589 unless (defined $bytes[$len - 1])
311 2 587 if ($bytes[$len - 1] == 255) { }
79 508 elsif ($bytes[$len - 1] == 254) { }
337 0 1468 unless (defined $bytes[0])
343 39 1429 if ($tag == 15)
344 0 39 unless (defined $bytes[1])
370 0 1612 unless (defined $bytes[0])
392 0 2075 unless (defined $bytes[0])
398 745 1330 if ($lvt == 5)
402 8 737 if (_is_tag_extended($bytes[0]))
406 0 745 unless (defined $bytes[$lvt_ext_position])
410 4 741 if ($bytes[$lvt_ext_position] == 255) { }
68 673 elsif ($bytes[$lvt_ext_position] == 254) { }
412 0 4 unless (defined $bytes[$lvt_ext_position + 1 + 3])
424 0 68 unless (defined $bytes[$lvt_ext_position + 1 + 1])
452 0 54 unless (defined $bytes[0])
458 0 54 if ($lvt == 5)
469 25 22 if (_get_head_ac_class($data_in) == 1 and _get_head_lvt($data_in) == 6 and _is_lvt_extended($data_in) == 0)
483 29 106 if (_get_head_ac_class($data_in) == 1 and _get_head_lvt($data_in) == 7 and _is_lvt_extended($data_in) == 0)
503 0 0 unless (defined $dt_class)
509 0 0 if ($tag != 1)
520 23 96 if ($bone->{'dt'} eq "BACnet::DataTypes::SequenceOfValues" or $bone->{'dt'} eq "BACnet::DataTypes::SequenceValue" or $bone->{'dt'} eq "BACnet::DataTypes::Choice")
575 0 498 unless (_correct_tag($data_in, $expected_tag))
579 0 498 unless (_correct_lvt($data_in, $lvt_expected_value))
583 0 498 if ($args{'lvt_is_length'} == 1 and not _current_length($data_in, _get_head_lvt($args{'data_in'})))
589 0 498 if (defined $expected_length and not _current_length($data_in, $expected_length))
601 412 86 if (_get_head_ac_class($data_in) == 0 and _get_head_tag($data_in) == $tag)
607 86 0 if (_get_head_ac_class($data_in) == 1 and _get_head_tag($data_in) != -1)
619 498 0 unless (defined $lvt_expected_value)
623 0 0 if (_get_head_lvt($data_in) != $lvt_expected_value)
633 625 0 if (length $data_in == $length_expected + _get_head_length($data_in))
647 13 511 if ($tag >= 15)
650 482 42 if ($short_lvt == 0)
651 184 298 if ($lvt >= 5)
659 13 511 if ($tag >= 15)
663 42 482 if ($short_lvt == 1)
667 1 481 if ($lvt >= 65536) { }
17 464 elsif ($lvt >= 254) { }
166 298 elsif ($lvt >= 5) { }
696 79 396 if (defined $modified_tag)
723 7 2 unless (defined $bone->{'skeleton'})
737 0 0 if (ref $substitution eq "HASH")