Use character literals for the signed BinaryType test

MSVC rejects char(0xFF) with C4310 (cast truncates constant value),
which the Windows workflow treats as an error. The character literals
carry the same byte values without a narrowing cast.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-08-28 17:53:02 +00:00
parent 0e4ad2e8da
commit 110cd31e8f
+1 -1
View File
@@ -1167,7 +1167,7 @@ TEST_CASE("regression tests 2")
using json_char_binary = nlohmann::basic_json <
std::map, std::vector, std::string, bool, std::int64_t, std::uint64_t,
double, std::allocator, nlohmann::adl_serializer, std::vector<char>, void >;
const std::vector<char> chars{char(0), char(1), char(0xFF)};
const std::vector<char> chars{'\0', '\x01', '\xFF'};
CHECK(json_char_binary::binary(chars).dump() == R"({"bytes":[0,1,255],"subtype":null})");
// the default binary type is unchanged