diff --git a/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md b/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md index cea009e4e..28bd99535 100644 --- a/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md +++ b/docs/mkdocs/docs/api/basic_json/cbor_tag_handler_t.md @@ -18,7 +18,8 @@ ignore : ignore tags 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 diff --git a/tests/src/unit-msgpack.cpp b/tests/src/unit-msgpack.cpp index 077073052..de4255b4a 100644 --- a/tests/src/unit-msgpack.cpp +++ b/tests/src/unit-msgpack.cpp @@ -2208,8 +2208,11 @@ TEST_CASE("MessagePack Size above uint32 for array") auto& array = j.get_ref(); 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 result; 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::out_of_range&); @@ -2261,8 +2264,11 @@ TEST_CASE("MessagePack Size above uint32 for object") auto& object = j.get_ref(); 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 result; 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::out_of_range&);