From 6d9b21f070b2e39569995527ac6b4879bb29023d Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 8 Sep 2021 15:31:08 -0400 Subject: [PATCH] Test C++ build of list head init Signed-off-by: Simon Marchi Signed-off-by: Mathieu Desnoyers Change-Id: Iaf7655c8a8e76d004910da14343bbebc4309576e --- tests/unit/test_build.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/unit/test_build.c b/tests/unit/test_build.c index 64db773..4c3392d 100644 --- a/tests/unit/test_build.c +++ b/tests/unit/test_build.c @@ -93,6 +93,19 @@ static void test_wfcqueue(void) ok(1, "cds_wfcq_empty"); } +static +void test_build_cds_list_head_init(void) +{ + /* Test that the CDS_LIST_HEAD_INIT macro builds correctly. */ + struct struct_with_list { + struct cds_list_head head; + }; + + struct struct_with_list list = { + .head = CDS_LIST_HEAD_INIT(list.head), + }; +} + int main(void) { /* Need at least 1 test to make a valid TAP test plan. */ @@ -102,6 +115,7 @@ int main(void) test_lfstack(); test_wfstack(); test_wfcqueue(); + test_build_cds_list_head_init(); return exit_status(); } -- 2.34.1