Test C++ build of list head init
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 8 Sep 2021 19:31:08 +0000 (15:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 8 Sep 2021 19:33:29 +0000 (15:33 -0400)
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iaf7655c8a8e76d004910da14343bbebc4309576e

tests/unit/test_build.c

index 64db7732d966be04f5ead8b9d741b8fe27cea85f..4c3392d6779e884fe5f5e08d49b0060bef6ed778 100644 (file)
@@ -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();
 }
This page took 0.026787 seconds and 4 git commands to generate.