1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

improved test coverage

This commit is contained in:
Niels Lohmann
2018-03-20 18:49:10 +01:00
parent 9e07e9b4ec
commit 99ecca55c4
6 changed files with 269 additions and 5 deletions

View File

@ -5699,6 +5699,7 @@ class binary_reader
using json_sax_t = json_sax<BasicJsonType>;
public:
/// the supported binary input formats
enum class binary_format_t { cbor, msgpack, ubjson };
/*!
@ -7016,8 +7017,8 @@ class binary_reader
default:
{
result = std::size_t(-1);
return true;
auto last_token = get_token_string();
return sax->parse_error(chars_read, last_token, parse_error::create(113, chars_read, "byte after '#' must denote a number type; last byte: 0x" + last_token));
}
}
}
@ -7050,6 +7051,10 @@ class binary_reader
get_ignore_noop();
if (JSON_UNLIKELY(current != '#'))
{
if (JSON_UNLIKELY(not unexpect_eof()))
{
return false;
}
auto last_token = get_token_string();
return sax->parse_error(chars_read, last_token, parse_error::create(112, chars_read, "expected '#' after UBJSON type information; last byte: 0x" + last_token));
}