pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pcmk__clear_flags_as_test.c
Go to the documentation of this file.
1/*
2 * Copyright 2020-2021 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 General Public License version 2
7 * or later (GPLv2+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
13
14static void
15clear_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
22static void
23clear_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
30static void
31clear_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
38PCMK__UNIT_TEST(NULL, NULL,
39 cmocka_unit_test(clear_none),
40 cmocka_unit_test(clear_some),
41 cmocka_unit_test(clear_all))
#define LOG_TRACE
Definition logging.h:38
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)