diff options
Diffstat (limited to 'src/test/test-memory-util.c')
-rw-r--r-- | src/test/test-memory-util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/test-memory-util.c b/src/test/test-memory-util.c new file mode 100644 index 0000000000..241f46c0d0 --- /dev/null +++ b/src/test/test-memory-util.c @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#include "memory-util.h" +#include "tests.h" + +TEST(eqzero) { + const uint32_t zeros[] = {0, 0, 0}; + const uint32_t ones[] = {1, 1}; + const uint32_t mixed[] = {0, 1, 0, 0, 0}; + const uint8_t longer[] = {[55] = 255}; + + assert_se(eqzero(zeros)); + assert_se(!eqzero(ones)); + assert_se(!eqzero(mixed)); + assert_se(!eqzero(longer)); +} + +DEFINE_TEST_MAIN(LOG_INFO); |