This source file includes following definitions.
- check_defaults
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
13 #include <crm/pengine/internal.h>
14 #include <crm/pengine/pe_types.h>
15 #include <crm/pengine/status.h>
16
17 #include "mock_private.h"
18
19 static void
20 check_defaults(void **state) {
21 uint32_t flags;
22 pe_working_set_t *data_set = calloc(1, sizeof(pe_working_set_t));
23
24 set_working_set_defaults(data_set);
25
26 flags = pe_flag_stop_rsc_orphans|pe_flag_symmetric_cluster|pe_flag_stop_action_orphans;
27
28 if (!strcmp(PCMK__CONCURRENT_FENCING_DEFAULT, "true")) {
29 flags |= pe_flag_concurrent_fencing;
30 }
31
32
33 assert_null(data_set->priv);
34 assert_int_equal(data_set->order_id, 1);
35 assert_int_equal(data_set->action_id, 1);
36 assert_int_equal(data_set->no_quorum_policy, no_quorum_stop);
37 assert_int_equal(data_set->flags, flags);
38
39
40
41
42 free(data_set);
43 }
44
45 PCMK__UNIT_TEST(NULL, NULL,
46 cmocka_unit_test(check_defaults))