From d9a77d396cbe610f95e6b98912148942cb26c0e7 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 20 Oct 2021 11:23:06 +0200 Subject: [PATCH] tests: Fixed endian test being marked as failing --- tests/algorithms/source/endian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/algorithms/source/endian.cpp b/tests/algorithms/source/endian.cpp index de17ad022..d1cc86c30 100644 --- a/tests/algorithms/source/endian.cpp +++ b/tests/algorithms/source/endian.cpp @@ -6,12 +6,12 @@ TEST_SEQUENCE("32BitIntegerEndianSwap") { TEST_ASSERT(hex::changeEndianess(0xAABBCCDD, std::endian::big) == 0xDDCCBBAA); }; -TEST_SEQUENCE("64BitFloatEndianSwap", FAILING) { +TEST_SEQUENCE("64BitFloatEndianSwap") { double floatValue = 1234.5; u64 integerValue = reinterpret_cast(floatValue); double swappedFloatValue = hex::changeEndianess(floatValue, std::endian::big); u64 swappedIntegerValue = hex::changeEndianess(integerValue, std::endian::big); - TEST_ASSERT(std::memcmp(&floatValue, &integerValue, 8) && std::memcmp(&swappedFloatValue, &swappedIntegerValue, 8)); + TEST_ASSERT(std::memcmp(&floatValue, &integerValue, 8) == 0 && std::memcmp(&swappedFloatValue, &swappedIntegerValue, 8) == 0); }; \ No newline at end of file