From 2d813cc4c26af142bcfaabdf654371e7801f6491 Mon Sep 17 00:00:00 2001 From: Clement Sibille Date: Mon, 20 May 2024 00:52:17 +0900 Subject: Add bytes module --- tests/bytes.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/bytes.c (limited to 'tests/bytes.c') diff --git a/tests/bytes.c b/tests/bytes.c new file mode 100644 index 0000000..2d6f95b --- /dev/null +++ b/tests/bytes.c @@ -0,0 +1,10 @@ +#include "test.h" +#include + +void t_float_from_bytes_le(void) { + const u8 bytes[4] = {154, 153, 137, 64}; + float number = float_from_bytes_le(bytes); + T_ASSERT_FLOAT_EQ(number, 4.3, 0.01); +} + +TEST_SUITE(TEST(t_float_from_bytes_le)) -- cgit v1.2.3