mirror of
https://github.com/nlohmann/json.git
synced 2026-08-29 12:27:32 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user