This source file includes following definitions.
- all_set
- one_is_set
- main
1
2
3
4
5
6
7
8
9
10 #include <stdio.h>
11 #include <stdbool.h>
12 #include <crm_internal.h>
13
14 static void
15 all_set(void) {
16 g_assert_cmpint(pcmk_all_flags_set(0x000, 0x003), ==, false);
17 g_assert_cmpint(pcmk_all_flags_set(0x00f, 0x003), ==, true);
18 g_assert_cmpint(pcmk_all_flags_set(0x00f, 0x010), ==, false);
19 g_assert_cmpint(pcmk_all_flags_set(0x00f, 0x011), ==, false);
20 g_assert_cmpint(pcmk_all_flags_set(0x000, 0x000), ==, true);
21 g_assert_cmpint(pcmk_all_flags_set(0x00f, 0x000), ==, true);
22 }
23
24 static void
25 one_is_set(void) {
26
27 g_assert_cmpint(pcmk_is_set(0x00f, 0x001), ==, true);
28 g_assert_cmpint(pcmk_is_set(0x00f, 0x010), ==, false);
29 }
30
31 int
32 main(int argc, char **argv)
33 {
34 g_test_init(&argc, &argv, NULL);
35
36 g_test_add_func("/common/flags/all_set/all_set", all_set);
37 g_test_add_func("/common/flags/all_set/is_set", one_is_set);
38 return g_test_run();
39 }