From c3531ee1011a6027f66102c631c45fe077a09202 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 16 Sep 2021 17:04:23 +0200 Subject: Added ByteSwap() tests --- zencore/intmath.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'zencore/intmath.cpp') diff --git a/zencore/intmath.cpp b/zencore/intmath.cpp index 4039a3b39..ae65085b6 100644 --- a/zencore/intmath.cpp +++ b/zencore/intmath.cpp @@ -1,5 +1,6 @@ // Copyright Epic Games, Inc. All Rights Reserved. +#include #include #include @@ -51,6 +52,10 @@ TEST_CASE("intmath") CHECK(CountTrailingZeros64(0x0000'0000'0000'0001ull) == 0); CHECK(CountTrailingZeros64(0x0000'0000'8000'0000ull) == 31); CHECK(CountTrailingZeros64(0x0000'0001'0000'0000ull) == 32); + + CHECK(ByteSwap(uint16_t(0x6d72)) == 0x726d); + CHECK(ByteSwap(uint32_t(0x2741'3965)) == 0x6539'4127); + CHECK(ByteSwap(uint64_t(0x214d'6172'7469'6e21ull)) == 0x216e'6974'7261'4d21ull); } } // namespace zen -- cgit v1.2.3