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 <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-27 15:58:59 +02:00
committed by GitHub
parent 6bd106893a
commit f682cd2ef1

View File

@@ -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<typename T, typename A = std::allocator<T>>
struct huge_array : std::vector<T, A>
{
@@ -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
{