From 7cd3b7caee10d62f7be674afb86a136bf30485d6 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 15 Dec 2025 14:42:29 +0100 Subject: Add mqueue rt api, add header tests --- tests/headers/endian.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/headers/endian.c (limited to 'tests/headers/endian.c') 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 + +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); +} -- cgit v1.2.3