returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"expected a CBOR string; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::cbor,"expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x"+last_token,"string")));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"expected a UBJSON string; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::ubjson,"expected length type specification (U, i, I, l, L); last byte: 0x"+last_token,"string")));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"byte after '#' must denote a number type; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::ubjson,"expected length type specification (U, i, I, l, L) after '#'; last byte: 0x"+last_token,"size")));
}
}
}
...
...
@@ -1401,7 +1404,7 @@ class binary_reader
if(current=='$')
{
result.second=get();// must not ignore 'N', because 'N' maybe the type
returnsax->parse_error(chars_read,last_token,parse_error::create(112,chars_read,"expected '#' after UBJSON type information; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(112,chars_read,exception_message(input_format_t::ubjson,"expected '#' after type information; last byte: 0x"+last_token,"size")));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"byte after 'C' must be in range 0x00..0x7F; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::ubjson,"byte after 'C' must be in range 0x00..0x7F; last byte: 0x"+last_token,"char")));
}
string_ts(1,static_cast<char>(current));
returnsax->string(s);
...
...
@@ -1518,7 +1521,7 @@ class binary_reader
default:// anything else
{
autolast_token=get_token_string();
returnsax->parse_error(chars_read,last_token,parse_error::create(112,chars_read,"error reading UBJSON; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"expected a CBOR string; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::cbor,"expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x"+last_token,"string")));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"expected a UBJSON string; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::ubjson,"expected length type specification (U, i, I, l, L); last byte: 0x"+last_token,"string")));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"byte after '#' must denote a number type; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::ubjson,"expected length type specification (U, i, I, l, L) after '#'; last byte: 0x"+last_token,"size")));
}
}
}
...
...
@@ -7598,7 +7601,7 @@ class binary_reader
if(current=='$')
{
result.second=get();// must not ignore 'N', because 'N' maybe the type
returnsax->parse_error(chars_read,last_token,parse_error::create(112,chars_read,"expected '#' after UBJSON type information; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(112,chars_read,exception_message(input_format_t::ubjson,"expected '#' after type information; last byte: 0x"+last_token,"size")));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,"byte after 'C' must be in range 0x00..0x7F; last byte: 0x"+last_token));
returnsax->parse_error(chars_read,last_token,parse_error::create(113,chars_read,exception_message(input_format_t::ubjson,"byte after 'C' must be in range 0x00..0x7F; last byte: 0x"+last_token,"char")));
}
string_ts(1,static_cast<char>(current));
returnsax->string(s);
...
...
@@ -7715,7 +7718,7 @@ class binary_reader
default:// anything else
{
autolast_token=get_token_string();
returnsax->parse_error(chars_read,last_token,parse_error::create(112,chars_read,"error reading UBJSON; last byte: 0x"+last_token));
"[json.exception.parse_error.113] parse error at byte 2: expected a CBOR string; last byte: 0xFF");
"[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xFF");
"[json.exception.parse_error.113] parse error at byte 2: expected a CBOR string; last byte: 0x98");
"[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0x98");
// related test case: nonempty UTF-8 string (indefinite length)
"[json.exception.parse_error.113] parse error at byte 13: expected a CBOR string; last byte: 0xB4");
"[json.exception.parse_error.113] parse error at byte 13: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xB4");
"[json.exception.parse_error.113] parse error at byte 13: expected a CBOR string; last byte: 0xB4");
"[json.exception.parse_error.113] parse error at byte 13: syntax error while parsing CBOR string: expected length specification (0x60-0x7B) or indefinite string type (0x7F); last byte: 0xB4");
CHECK_THROWS_WITH(json::to_ubjson(j),"[json.exception.out_of_range.407] number overflow serializing 9223372036854775808");
CHECK_THROWS_WITH(json::to_ubjson(j),"[json.exception.out_of_range.407] integer number 9223372036854775808 cannot be represented by UBJSON as it does not fit int64");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 2: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON char: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.113] parse error at byte 2: byte after 'C' must be in range 0x00..0x7F; last byte: 0x82");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing UBJSON char: byte after 'C' must be in range 0x00..0x7F; last byte: 0x82");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 2: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.113] parse error at byte 2: expected a UBJSON string; last byte: 0x31");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing UBJSON string: expected length type specification (U, i, I, l, L); last byte: 0x31");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.112] parse error at byte 4: expected '#' after UBJSON type information; last byte: 0x02");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing UBJSON size: expected '#' after type information; last byte: 0x02");
CHECK_THROWS_WITH(json::from_ubjson(vS),"[json.exception.parse_error.110] parse error at byte 2: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vS),"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 5: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing UBJSON string: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vC),"[json.exception.parse_error.110] parse error at byte 2: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vC),"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing UBJSON char: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vU),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vU),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vi),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vi),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vI),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vI),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vl),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vl),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vL),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vL),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v0),"[json.exception.parse_error.113] parse error at byte 3: byte after '#' must denote a number type; last byte: 0x54");
CHECK_THROWS_WITH(json::from_ubjson(v0),"[json.exception.parse_error.113] parse error at byte 3: syntax error while parsing UBJSON size: expected length type specification (U, i, I, l, L) after '#'; last byte: 0x54");
CHECK_THROWS_WITH(json::from_ubjson(v0),"[json.exception.parse_error.110] parse error at byte 3: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v0),"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing UBJSON type: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vi),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vi),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vT),"[json.exception.parse_error.110] parse error at byte 4: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vT),"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST),"[json.exception.parse_error.110] parse error at byte 8: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST),"[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vS),"[json.exception.parse_error.110] parse error at byte 7: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vS),"[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 6: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST),"[json.exception.parse_error.110] parse error at byte 11: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST),"[json.exception.parse_error.110] parse error at byte 11: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vT),"[json.exception.parse_error.112] parse error at byte 4: expected '#' after UBJSON type information; last byte: 0x69");
CHECK_THROWS_WITH(json::from_ubjson(vT),"[json.exception.parse_error.112] parse error at byte 4: syntax error while parsing UBJSON size: expected '#' after type information; last byte: 0x69");
CHECK_THROWS_WITH(json::from_ubjson(vS),"[json.exception.parse_error.110] parse error at byte 10: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vS),"[json.exception.parse_error.110] parse error at byte 10: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 7: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v),"[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v2),"[json.exception.parse_error.110] parse error at byte 8: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v2),"[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v3),"[json.exception.parse_error.110] parse error at byte 5: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(v3),"[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing UBJSON value: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST1),"[json.exception.parse_error.110] parse error at byte 10: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST1),"[json.exception.parse_error.110] parse error at byte 10: syntax error while parsing UBJSON number: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST2),"[json.exception.parse_error.110] parse error at byte 8: unexpected end of input");
CHECK_THROWS_WITH(json::from_ubjson(vST2),"[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing UBJSON value: unexpected end of input");