From 5a97ab4d37425c797338961819fc6c21a957c659 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 15 Nov 2020 16:38:01 +0100 Subject: [PATCH] tests: list: use FOREACH_ENTRY macro --- tests/list.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/list.c b/tests/list.c index 98bc57b..7ed3549 100644 --- a/tests/list.c +++ b/tests/list.c @@ -538,13 +538,11 @@ Test(list, filter) { cr_assert_eq(count, ARR_SIZE(arr)); size_t count_even = 0; - LIST_FOREACH_CONST(res, it) { - struct int_list *n = CONTAINER_OF(struct int_list, list, it); + LIST_FOREACH_ENTRY(const struct int_list, list, res, n) { cr_assert_eq(n->val, ++count_even * 2); } size_t count_odd = 0; - LIST_FOREACH_CONST(l, it) { - struct int_list *n = CONTAINER_OF(struct int_list, list, it); + LIST_FOREACH_ENTRY(const struct int_list, list, l, n) { cr_assert_eq(n->val, ++count_odd * 2 - 1); } cr_assert_eq(count_even + count_odd, ARR_SIZE(arr));