From 3c7a9397438d8de0a072df48565f5c9eee6dfab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Tue, 24 Mar 2020 16:20:39 -0700 Subject: [PATCH] tests: add util.h MACRO_MAP_CAT test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This wasn't tested when it was first added. Signed-off-by: Martí Bolívar --- tests/unit/util/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/util/main.c b/tests/unit/util/main.c index 5f5671220f4..2b6f9c0ef00 100644 --- a/tests/unit/util/main.c +++ b/tests/unit/util/main.c @@ -153,6 +153,16 @@ void test_UTIL_LISTIFY(void) zassert_equal(a3, 6, NULL); } +void test_MACRO_MAP_CAT(void) +{ + int item_a_item_b_item_c_ = 1; + +#undef FOO +#define FOO(x) item_##x##_ + zassert_equal(MACRO_MAP_CAT(FOO, a, b, c), 1, "MACRO_MAP_CAT"); +#undef FOO +} + static int inc_func(void) { static int a = 1; @@ -182,6 +192,7 @@ void test_main(void) ztest_unit_test(test_COND_CODE_0), ztest_unit_test(test_IF_ENABLED), ztest_unit_test(test_UTIL_LISTIFY), + ztest_unit_test(test_MACRO_MAP_CAT), ztest_unit_test(test_z_max_z_min) );