Skip to content

Commit

Permalink
Exclude unreachable lines from coverage
Browse files Browse the repository at this point in the history
Certain lines are unreachable in 64bit builds.
  • Loading branch information
falbrechtskirchinger committed Jun 8, 2022
1 parent 5bbe2c6 commit fc6ac6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions include/nlohmann/detail/input/binary_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2081,8 +2081,9 @@ class binary_reader
}
if (!value_in_range_of<std::size_t>(number))
{
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408,
exception_message(input_format, "integer value overflow", "size"), nullptr));
// undo coverage exclusion once the 32bit test is run as part of CI (#3524)
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // LCOV_EXCL_LINE
exception_message(input_format, "integer value overflow", "size"), nullptr)); // LCOV_EXCL_LINE
}
result = static_cast<std::size_t>(number);
return true;
Expand Down Expand Up @@ -2131,8 +2132,9 @@ class binary_reader
}
if (!value_in_range_of<std::size_t>(number))
{
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408,
exception_message(input_format, "integer value overflow", "size"), nullptr));
// undo coverage exclusion once the 32bit test is run as part of CI (#3524)
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // LCOV_EXCL_LINE
exception_message(input_format, "integer value overflow", "size"), nullptr)); // LCOV_EXCL_LINE
}
result = detail::conditional_static_cast<std::size_t>(number);
return true;
Expand Down
10 changes: 6 additions & 4 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10766,8 +10766,9 @@ class binary_reader
}
if (!value_in_range_of<std::size_t>(number))
{
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408,
exception_message(input_format, "integer value overflow", "size"), nullptr));
// undo coverage exclusion once the 32bit test is run as part of CI (#3524)
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // LCOV_EXCL_LINE
exception_message(input_format, "integer value overflow", "size"), nullptr)); // LCOV_EXCL_LINE
}
result = static_cast<std::size_t>(number);
return true;
Expand Down Expand Up @@ -10816,8 +10817,9 @@ class binary_reader
}
if (!value_in_range_of<std::size_t>(number))
{
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408,
exception_message(input_format, "integer value overflow", "size"), nullptr));
// undo coverage exclusion once the 32bit test is run as part of CI (#3524)
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // LCOV_EXCL_LINE
exception_message(input_format, "integer value overflow", "size"), nullptr)); // LCOV_EXCL_LINE
}
result = detail::conditional_static_cast<std::size_t>(number);
return true;
Expand Down

0 comments on commit fc6ac6a

Please sign in to comment.