diff options
Diffstat (limited to 'tests/vb2_common_tests.c')
-rw-r--r-- | tests/vb2_common_tests.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/vb2_common_tests.c b/tests/vb2_common_tests.c index 3bb24e3b..acc904e9 100644 --- a/tests/vb2_common_tests.c +++ b/tests/vb2_common_tests.c @@ -11,6 +11,20 @@ #include "vboot_struct.h" /* For old struct sizes */ /* + * Test array size macro. + */ +static void test_array_size(void) +{ + uint8_t arr1[12]; + uint32_t arr2[7]; + uint64_t arr3[9]; + + TEST_EQ(ARRAY_SIZE(arr1), 12, "ARRAYSIZE(uint8_t)"); + TEST_EQ(ARRAY_SIZE(arr2), 7, "ARRAYSIZE(uint32_t)"); + TEST_EQ(ARRAY_SIZE(arr3), 9, "ARRAYSIZE(uint64_t)"); +} + +/* * Test struct packing for vboot_struct.h structs which are passed between * firmware and OS, or passed between different phases of firmware. */ @@ -218,6 +232,7 @@ static void test_helper_functions(void) int main(int argc, char* argv[]) { + test_array_size(); test_struct_packing(); test_memcmp(); test_align(); |