From 6f99d5b2e978ee6ef448fe39a426ba12c101f8f9 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 8 Apr 2017 23:39:17 +0200 Subject: [PATCH] :hammer: fixed test case One test case for CBOR and MessagePack assumed little endianess. --- test/src/unit-cbor.cpp | 7 +------ test/src/unit-msgpack.cpp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/test/src/unit-cbor.cpp b/test/src/unit-cbor.cpp index ae6f9a76..debb3732 100644 --- a/test/src/unit-cbor.cpp +++ b/test/src/unit-cbor.cpp @@ -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); } } diff --git a/test/src/unit-msgpack.cpp b/test/src/unit-msgpack.cpp index 3f1d1643..a580913d 100644 --- a/test/src/unit-msgpack.cpp +++ b/test/src/unit-msgpack.cpp @@ -676,14 +676,9 @@ TEST_CASE("MessagePack") const auto result = json::to_msgpack(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_msgpack(result) == j); + CHECK(json::from_msgpack(result) == v); } } }