aboutsummaryrefslogtreecommitdiff
path: root/lib/tst/endian_little.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tst/endian_little.cc')
-rw-r--r--lib/tst/endian_little.cc38
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/tst/endian_little.cc b/lib/tst/endian_little.cc
deleted file mode 100644
index 9c8c73b..0000000
--- a/lib/tst/endian_little.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <endian.h>
-#include <gtest/gtest.h>
-
-namespace libk {
-#include "../libk/endian/little.c"
-} // namespace libk
-
-TEST(endian_little, htole16)
-{
- EXPECT_EQ(static_cast<uint16_t>(0xabcd), libk::htole16(0xabcd));
- EXPECT_EQ(libk::htole16(0xabcd), htole16(0xabcd));
-}
-TEST(endian_little, htole32)
-{
- EXPECT_EQ(static_cast<uint32_t>(0xabcd0123), libk::htole32(0xabcd0123));
- EXPECT_EQ(libk::htole32(0xabcd0123), htole32(0xabcd0123));
-}
-TEST(endian_little, htole64)
-{
- EXPECT_EQ(static_cast<uint64_t>(0x0123456789abcdef), libk::htole64(0x0123456789abcdef));
- EXPECT_EQ(libk::htole64(0xabcdef0123456789), htole64(0xabcdef0123456789));
-}
-
-TEST(endian_little, htobe16)
-{
- EXPECT_EQ(static_cast<uint16_t>(0xabcd), libk::htobe16(0xcdab));
- EXPECT_EQ(libk::htobe16(0xabcd), htobe16(0xabcd));
-}
-TEST(endian_little, htobe32)
-{
- EXPECT_EQ(static_cast<uint32_t>(0xabcd0123), libk::htobe32(0x2301cdab));
- EXPECT_EQ(libk::htobe32(0xabcd0123), htobe32(0xabcd0123));
-}
-TEST(endian_little, htobe64)
-{
- EXPECT_EQ(static_cast<uint64_t>(0x0123456789abcdef), libk::htobe64(0xefcdab8967452301));
- EXPECT_EQ(libk::htobe64(0xabcdef0123456789), htobe64(0xabcdef0123456789));
-}