Clean up code

This commit is contained in:
2024-05-05 19:13:24 +05:30
parent b77cc5639c
commit 91af3e14ef
4 changed files with 9 additions and 8 deletions

View File

@@ -184,7 +184,7 @@ void test_lib_base_bytes_to_hword(void)
} tests[] = {{{0, 0, 0, 0}, 0},
{{0xFF, 0xFF, 0xFF, 0xFF}, HWORD_MAX},
{{1, 0, 0, 0}, 1},
{{0, 0, 0, 0b10000000}, 1U << 31},
{{0, 0, 0, 0x80}, 1U << 31},
{{0x89, 0xab, 0xcd, 0xef}, 0xefcdab89}};
const size_t n = size_byte_array_to_string(4);
@@ -216,7 +216,7 @@ void test_lib_base_bytes_to_word(void)
{{0, 0, 0, 0}, 0},
{{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, WORD_MAX},
{{0x01, 0, 0, 0, 0, 0, 0, 0}, 1},
{{0, 0, 0, 0, 0, 0, 0, 0b10000000}, 1LU << 63},
{{0, 0, 0, 0, 0, 0, 0, 0x80}, 1LU << 63},
{{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, 0xefcdab8967452301}};
const size_t n = size_byte_array_to_string(8);
@@ -283,7 +283,7 @@ void test_lib_base_word_to_bytes(void)
{0, {0, 0, 0, 0}},
{WORD_MAX, {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}},
{1, {0x01, 0, 0, 0, 0, 0, 0, 0}},
{1LU << 63, {0, 0, 0, 0, 0, 0, 0, 0b10000000}},
{1LU << 63, {0, 0, 0, 0, 0, 0, 0, 0x80}},
{0xefcdab8967452301, {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}}};
for (size_t i = 0; i < ARR_SIZE(tests); ++i)