summaryrefslogtreecommitdiff
path: root/tests/headers/endian.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-15 14:42:29 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-15 14:42:29 +0100
commit7cd3b7caee10d62f7be674afb86a136bf30485d6 (patch)
tree121a8c79114174b765713387187d930b102f760f /tests/headers/endian.c
parent3b3325f761b09ebbfef04c44eed546cc4fdeb329 (diff)
Add mqueue rt api, add header tests
Diffstat (limited to 'tests/headers/endian.c')
-rw-r--r--tests/headers/endian.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/headers/endian.c b/tests/headers/endian.c
new file mode 100644
index 00000000..db18c5fc
--- /dev/null
+++ b/tests/headers/endian.c
@@ -0,0 +1,32 @@
+// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/endian.h.html
+
+#include "core.h"
+
+#include <endian.h>
+
+TEST(endian_h)
+{
+ MACRO(BYTE_ORDER);
+ MACRO(LITTLE_ENDIAN);
+ MACRO(BIG_ENDIAN);
+
+ FUNCTION(be16toh, FN(uint16_t, uint16_t));
+ FUNCTION(be32toh, FN(uint32_t, uint32_t));
+ FUNCTION(be64toh, FN(uint64_t, uint64_t));
+
+ FUNCTION(htobe16, FN(uint16_t, uint16_t));
+ FUNCTION(htobe32, FN(uint32_t, uint32_t));
+ FUNCTION(htobe64, FN(uint64_t, uint64_t));
+
+ FUNCTION(htole16, FN(uint16_t, uint16_t));
+ FUNCTION(htole32, FN(uint32_t, uint32_t));
+ FUNCTION(htole64, FN(uint64_t, uint64_t));
+
+ FUNCTION(le16toh, FN(uint16_t, uint16_t));
+ FUNCTION(le32toh, FN(uint32_t, uint32_t));
+ FUNCTION(le64toh, FN(uint64_t, uint64_t));
+
+ TYPE(uint16_t);
+ TYPE(uint32_t);
+ TYPE(uint64_t);
+}