Exclude unreachable lines from coverage

Certain lines are unreachable in 64bit builds.
This commit is contained in:
Florian Albrechtskirchinger 2022-06-08 13:57:01 +02:00
parent 5bbe2c670a
commit fc6ac6a39d
No known key found for this signature in database
GPG Key ID: 19618CE9B2D4BE6D
2 changed files with 12 additions and 8 deletions

View File

@ -2081,8 +2081,9 @@ class binary_reader
} }
if (!value_in_range_of<std::size_t>(number)) if (!value_in_range_of<std::size_t>(number))
{ {
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // undo coverage exclusion once the 32bit test is run as part of CI (#3524)
exception_message(input_format, "integer value overflow", "size"), nullptr)); 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); result = static_cast<std::size_t>(number);
return true; return true;
@ -2131,8 +2132,9 @@ class binary_reader
} }
if (!value_in_range_of<std::size_t>(number)) if (!value_in_range_of<std::size_t>(number))
{ {
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // undo coverage exclusion once the 32bit test is run as part of CI (#3524)
exception_message(input_format, "integer value overflow", "size"), nullptr)); 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); result = detail::conditional_static_cast<std::size_t>(number);
return true; return true;

View File

@ -10766,8 +10766,9 @@ class binary_reader
} }
if (!value_in_range_of<std::size_t>(number)) if (!value_in_range_of<std::size_t>(number))
{ {
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // undo coverage exclusion once the 32bit test is run as part of CI (#3524)
exception_message(input_format, "integer value overflow", "size"), nullptr)); 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); result = static_cast<std::size_t>(number);
return true; return true;
@ -10816,8 +10817,9 @@ class binary_reader
} }
if (!value_in_range_of<std::size_t>(number)) if (!value_in_range_of<std::size_t>(number))
{ {
return sax->parse_error(chars_read, get_token_string(), out_of_range::create(408, // undo coverage exclusion once the 32bit test is run as part of CI (#3524)
exception_message(input_format, "integer value overflow", "size"), nullptr)); 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); result = detail::conditional_static_cast<std::size_t>(number);
return true; return true;