pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
pcmk_has_quorum_test.c
Go to the documentation of this file.
1 /*
2  * Copyright 2024 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 
12 #include <crm/common/scheduler.h>
14 
15 static void
16 null_scheduler(void **state)
17 {
18  assert_false(pcmk_has_quorum(NULL));
19 }
20 
21 static void
22 valid_scheduler(void **state)
23 {
26  };
27 
28  assert_true(pcmk_has_quorum(&scheduler));
29 
31  assert_false(pcmk_has_quorum(&scheduler));
32 }
33 
34 PCMK__UNIT_TEST(NULL, NULL,
35  cmocka_unit_test(null_scheduler),
36  cmocka_unit_test(valid_scheduler))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
Scheduler API.
bool pcmk_has_quorum(const pcmk_scheduler_t *scheduler)
Definition: scheduler.c:85
pcmk_scheduler_t * scheduler
unsigned long long flags
Definition: scheduler.h:211