tests: Fixed endian test being marked as failing

This commit is contained in:
WerWolv 2021-10-20 11:23:06 +02:00
parent 442f164159
commit d9a77d396c
1 changed files with 2 additions and 2 deletions

View File

@ -6,12 +6,12 @@ TEST_SEQUENCE("32BitIntegerEndianSwap") {
TEST_ASSERT(hex::changeEndianess<u32>(0xAABBCCDD, std::endian::big) == 0xDDCCBBAA);
};
TEST_SEQUENCE("64BitFloatEndianSwap", FAILING) {
TEST_SEQUENCE("64BitFloatEndianSwap") {
double floatValue = 1234.5;
u64 integerValue = reinterpret_cast<u64&>(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);
};