🔨 fixed test case

One test case for CBOR and MessagePack assumed little endianess.
This commit is contained in:
Niels Lohmann 2017-04-08 23:39:17 +02:00
parent d62d48fc48
commit 6f99d5b2e9
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 2 additions and 12 deletions

View file

@ -727,14 +727,9 @@ TEST_CASE("CBOR")
const auto result = json::to_cbor(j); const auto result = json::to_cbor(j);
CHECK(result == expected); 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 // roundtrip
CHECK(json::from_cbor(result) == j); CHECK(json::from_cbor(result) == j);
CHECK(json::from_cbor(result) == v);
} }
} }

View file

@ -676,14 +676,9 @@ TEST_CASE("MessagePack")
const auto result = json::to_msgpack(j); const auto result = json::to_msgpack(j);
CHECK(result == expected); 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 // roundtrip
CHECK(json::from_msgpack(result) == j); CHECK(json::from_msgpack(result) == j);
CHECK(json::from_msgpack(result) == v);
} }
} }
} }