This source file includes following definitions.
- empty_list
- null_char
- in_list
- not_in_list
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
13
14 static void
15 empty_list(void **state)
16 {
17 assert_false(pcmk__char_in_any_str('x', NULL));
18 assert_false(pcmk__char_in_any_str('\0', NULL));
19 }
20
21 static void
22 null_char(void **state)
23 {
24 assert_true(pcmk__char_in_any_str('\0', "xxx", "yyy", NULL));
25 assert_true(pcmk__char_in_any_str('\0', "", NULL));
26 }
27
28 static void
29 in_list(void **state)
30 {
31 assert_true(pcmk__char_in_any_str('x', "aaa", "bbb", "xxx", NULL));
32 }
33
34 static void
35 not_in_list(void **state)
36 {
37 assert_false(pcmk__char_in_any_str('x', "aaa", "bbb", NULL));
38 assert_false(pcmk__char_in_any_str('A', "aaa", "bbb", NULL));
39 assert_false(pcmk__char_in_any_str('x', "", NULL));
40 }
41
42 PCMK__UNIT_TEST(NULL, NULL,
43 cmocka_unit_test(empty_list),
44 cmocka_unit_test(null_char),
45 cmocka_unit_test(in_list),
46 cmocka_unit_test(not_in_list))