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)
56
56
zassert_true ((y3 == 1 ), NULL );
57
57
}
58
58
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
+
59
79
/*test case main entry*/
60
80
void test_main (void )
61
81
{
62
82
ztest_test_suite (test_util_api ,
63
83
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 )
65
86
);
66
87
ztest_run_test_suite (test_util_api );
67
88
}
You can’t perform that action at this time.
0 commit comments