File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,33 @@ void test_COND_CODE_0(void)
5656 zassert_true ((y3 == 1 ), NULL );
5757}
5858
59+ void test_UTIL_LISTIFY (void )
60+ {
61+ int i = 0 ;
62+
63+ #define INC (x , _ ) \
64+ do { \
65+ i += x; \
66+ } while (0);
67+
68+ #define DEFINE (x , _ ) int a##x;
69+ #define MARK_UNUSED (x , _ ) ARG_UNUSED(a##x);
70+
71+ UTIL_LISTIFY (4 , DEFINE , _ )
72+ UTIL_LISTIFY (4 , MARK_UNUSED , _ )
73+
74+ UTIL_LISTIFY (4 , INC , _ )
75+
76+ zassert_equal (i , 0 + 1 + 2 + 3 , NULL );
77+ }
78+
5979/*test case main entry*/
6080void test_main (void )
6181{
6282 ztest_test_suite (test_util_api ,
6383 ztest_unit_test (test_COND_CODE_1 ),
64- ztest_unit_test (test_COND_CODE_0 )
84+ ztest_unit_test (test_COND_CODE_0 ),
85+ ztest_unit_test (test_UTIL_LISTIFY )
6586 );
6687 ztest_run_test_suite (test_util_api );
6788}
You can’t perform that action at this time.
0 commit comments