Skip to content

Commit 6f5f0b2

Browse files
nordic-krchcarlescufi
authored andcommitted
tests: unit: util: Extended UTIL_LISTIFY test
Extended test to check that multiple arguments are passed in UTIL_LISTIFY macro. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 9d33265 commit 6f5f0b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/unit/util/test.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ void test_UTIL_LISTIFY(void)
166166
{
167167
int i = 0;
168168

169-
#define INC(x, _) \
169+
#define INC(x, n, m) \
170170
do { \
171-
i += x; \
171+
i += (x + n + m);\
172172
} while (0);
173173

174174
#define DEFINE(x, y) int a##x = x * y;
@@ -177,9 +177,9 @@ void test_UTIL_LISTIFY(void)
177177
UTIL_LISTIFY(4, DEFINE, 2)
178178
UTIL_LISTIFY(4, MARK_UNUSED, _)
179179

180-
UTIL_LISTIFY(4, INC, _)
180+
UTIL_LISTIFY(4, INC, 1, 2)
181181

182-
zassert_equal(i, 0 + 1 + 2 + 3, NULL);
182+
zassert_equal(i, 0 + 1 + 2 + 3 + 4 * (1 + 2), NULL);
183183
zassert_equal(a0, 0, NULL);
184184
zassert_equal(a1, 2, NULL);
185185
zassert_equal(a2, 4, NULL);

0 commit comments

Comments
 (0)