mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 06:30:31 +00:00
Merge branch 'develop' into claude/issue-3885-3dcafd
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -18,7 +18,8 @@ ignore
|
|||||||
: ignore tags
|
: ignore tags
|
||||||
|
|
||||||
store
|
store
|
||||||
: store tagged byte strings (for bytes 0xd8..0xdb) as binary values with the tag as subtype; other tagged values are read as if the tag were ignored. If several tags precede a byte string, only the innermost one is stored.
|
: store tagged byte strings (for bytes 0xd8..0xdb) as binary values with the tag as subtype; other tagged values are
|
||||||
|
read as if the tag were ignored. If several tags precede a byte string, only the innermost one is stored.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|||||||
@@ -2208,8 +2208,11 @@ TEST_CASE("MessagePack Size above uint32 for array")
|
|||||||
auto& array = j.get_ref<huge_array_json::array_t&>();
|
auto& array = j.get_ref<huge_array_json::array_t&>();
|
||||||
array.fake_size = true;
|
array.fake_size = true;
|
||||||
|
|
||||||
|
// write into a caller-owned vector: to_msgpack(j) reserves space based on
|
||||||
|
// the (faked) element count, which fails with bad_alloc on Windows
|
||||||
|
std::vector<std::uint8_t> result;
|
||||||
CHECK_THROWS_WITH_AS(
|
CHECK_THROWS_WITH_AS(
|
||||||
huge_array_json::to_msgpack(j),
|
huge_array_json::to_msgpack(j, result),
|
||||||
"[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295",
|
"[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295",
|
||||||
json::out_of_range&);
|
json::out_of_range&);
|
||||||
|
|
||||||
@@ -2261,8 +2264,11 @@ TEST_CASE("MessagePack Size above uint32 for object")
|
|||||||
auto& object = j.get_ref<huge_object_json::object_t&>();
|
auto& object = j.get_ref<huge_object_json::object_t&>();
|
||||||
object.fake_size = true;
|
object.fake_size = true;
|
||||||
|
|
||||||
|
// write into a caller-owned vector: to_msgpack(j) reserves space based on
|
||||||
|
// the (faked) element count, which fails with bad_alloc on Windows
|
||||||
|
std::vector<std::uint8_t> result;
|
||||||
CHECK_THROWS_WITH_AS(
|
CHECK_THROWS_WITH_AS(
|
||||||
huge_object_json::to_msgpack(j),
|
huge_object_json::to_msgpack(j, result),
|
||||||
"[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295",
|
"[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295",
|
||||||
json::out_of_range&);
|
json::out_of_range&);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user