This source file includes following definitions.
- clear_none
- clear_some
- clear_all
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 clear_none(void **state) {
16 assert_int_equal(pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Test",
17 "test", 0x0f0, 0x00f, NULL), 0x0f0);
18 assert_int_equal(pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Test",
19 "test", 0x0f0, 0xf0f, NULL), 0x0f0);
20 }
21
22 static void
23 clear_some(void **state) {
24 assert_int_equal(pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Test",
25 "test", 0x0f0, 0x020, NULL), 0x0d0);
26 assert_int_equal(pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Test",
27 "test", 0x0f0, 0x030, NULL), 0x0c0);
28 }
29
30 static void
31 clear_all(void **state) {
32 assert_int_equal(pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Test",
33 "test", 0x0f0, 0x0f0, NULL), 0x000);
34 assert_int_equal(pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, "Test",
35 "test", 0x0f0, 0xfff, NULL), 0x000);
36 }
37
38 PCMK__UNIT_TEST(NULL, NULL,
39 cmocka_unit_test(clear_none),
40 cmocka_unit_test(clear_some),
41 cmocka_unit_test(clear_all))