aboutsummaryrefslogtreecommitdiff
path: root/zencore/intmath.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-28 15:09:15 +0200
committerPer Larsson <[email protected]>2021-09-28 15:09:15 +0200
commit141317786f9d59e95da8316ce40cf30e4dfd7b53 (patch)
tree3c863384c6ca68a30e82989994408c5f40159273 /zencore/intmath.cpp
parentRemoved using the bucket name to detect binary cache records and store conten... (diff)
parentapply: Re-enabled environment variable setup for child processes (diff)
downloadzen-141317786f9d59e95da8316ce40cf30e4dfd7b53.tar.xz
zen-141317786f9d59e95da8316ce40cf30e4dfd7b53.zip
Merge branch 'main' of https://github.com/EpicGames/zen
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