From f682cd2ef1677e1218d714abb177fa2a93eadccf Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 27 Sep 2026 15:58:59 +0200 Subject: [PATCH] Skip the #5515 MessagePack size tests on 32-bit platforms (#5590) The tests fake a container size of UINT32_MAX + 1, which does not fit into a 32-bit std::size_t: MSVC rejects the truncation (C4305/C4309 with /WX), and clang-cl wraps the size to 0 so nothing throws. Guard them with SIZE_MAX > UINT32_MAX like the tests from #5584. Signed-off-by: Niels Lohmann --- tests/src/unit-msgpack.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/src/unit-msgpack.cpp b/tests/src/unit-msgpack.cpp index cfb047495..e7616b27f 100644 --- a/tests/src/unit-msgpack.cpp +++ b/tests/src/unit-msgpack.cpp @@ -2164,6 +2164,8 @@ TEST_CASE("MessagePack with std::byte") } #endif +// the fake sizes below do not fit into a 32-bit std::size_t +#if SIZE_MAX > UINT32_MAX template> struct huge_array : std::vector { @@ -2330,6 +2332,7 @@ TEST_CASE("MessagePack Size above uint32 for binary") "[json.exception.out_of_range.412] MessagePack length 4294967296 exceeds maximum of 4294967295", json::out_of_range&); } +#endif namespace {