pacemaker  2.1.0-7c3f660
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pcmk_any_flags_set_test.c
Go to the documentation of this file.
1 /*
2  * Copyright 2020 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #include <stdio.h>
11 #include <stdbool.h>
12 #include <crm_internal.h>
13 
14 static void
15 any_set(void) {
16  g_assert_false(pcmk_any_flags_set(0x000, 0x000));
17  g_assert_false(pcmk_any_flags_set(0x000, 0x001));
18  g_assert_true(pcmk_any_flags_set(0x00f, 0x001));
19  g_assert_false(pcmk_any_flags_set(0x00f, 0x010));
20  g_assert_true(pcmk_any_flags_set(0x00f, 0x011));
21  g_assert_false(pcmk_any_flags_set(0x000, 0x000));
22  g_assert_false(pcmk_any_flags_set(0x00f, 0x000));
23 }
24 
25 int
26 main(int argc, char **argv)
27 {
28  g_test_init(&argc, &argv, NULL);
29 
30  g_test_add_func("/common/flags/any_set/any_set", any_set);
31  return g_test_run();
32 }
int main(int argc, char **argv)