From: Simon Marchi Date: Wed, 8 Sep 2021 19:31:08 +0000 (-0400) Subject: Test C++ build of list head init X-Git-Tag: v0.14.0~58 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=6d9b21f070b2e39569995527ac6b4879bb29023d;ds=sidebyside Test C++ build of list head init Signed-off-by: Simon Marchi Signed-off-by: Mathieu Desnoyers Change-Id: Iaf7655c8a8e76d004910da14343bbebc4309576e --- 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(); }