aboutsummaryrefslogtreecommitdiff
path: root/zencore/intmath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/intmath.cpp')
-rw-r--r--zencore/intmath.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/zencore/intmath.cpp b/zencore/intmath.cpp
index f11f5e8aa..5a686dc8e 100644
--- a/zencore/intmath.cpp
+++ b/zencore/intmath.cpp
@@ -1,5 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved.
+#include <zencore/endian.h>
#include <zencore/intmath.h>
#include <zencore/testing.h>
@@ -53,6 +54,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);
}
#endif