1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2015-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <fwk_assert.h>
9 #include <fwk_list.h>
10 #include <fwk_macros.h>
11 #include <fwk_test.h>
12 
test_slist_init(void)13 static void test_slist_init(void)
14 {
15     struct fwk_slist list;
16 
17     fwk_list_init(&list);
18 
19     assert(list.head == (struct fwk_slist_node *)&list);
20     assert(list.tail == (struct fwk_slist_node *)&list);
21 }
22 
test_dlist_init(void)23 static void test_dlist_init(void)
24 {
25     struct fwk_dlist list;
26 
27     fwk_list_init(&list);
28 
29     assert(list.head == (struct fwk_dlist_node *)&list);
30     assert(list.tail == (struct fwk_dlist_node *)&list);
31 }
32 
33 static const struct fwk_test_case_desc test_case_table[] = {
34     FWK_TEST_CASE(test_slist_init),
35     FWK_TEST_CASE(test_dlist_init),
36 };
37 
38 struct fwk_test_suite_desc test_suite = {
39     .name = "fwk_list_init",
40     .test_case_count = FWK_ARRAY_SIZE(test_case_table),
41     .test_case_table = test_case_table,
42 };
43