mirror of
https://github.com/nlohmann/json.git
synced 2026-02-22 19:36:26 +00:00
🔨 fixed test case
One test case for CBOR and MessagePack assumed little endianess.
This commit is contained in:
@@ -727,14 +727,9 @@ TEST_CASE("CBOR")
|
||||
const auto result = json::to_cbor(j);
|
||||
CHECK(result == expected);
|
||||
|
||||
// restore value (reverse array for endianess)
|
||||
double restored;
|
||||
std::reverse(expected.begin(), expected.end());
|
||||
memcpy(&restored, expected.data(), sizeof(double));
|
||||
CHECK(restored == v);
|
||||
|
||||
// roundtrip
|
||||
CHECK(json::from_cbor(result) == j);
|
||||
CHECK(json::from_cbor(result) == v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user