improved test coverage

This commit is contained in:
Niels Lohmann 2018-03-20 18:49:10 +01:00
parent 9e07e9b4ec
commit 99ecca55c4
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
6 changed files with 269 additions and 5 deletions

View file

@ -1359,8 +1359,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));
}
}
}
@ -1393,6 +1393,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));
}