This source file includes following definitions.
- null_resource
- resource_is_managed
- resource_is_not_managed
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <stdio.h>
13
14 #include <crm/common/resources.h>
15 #include <crm/common/unittest_internal.h>
16
17 static void
18 null_resource(void **state)
19 {
20 assert_false(pcmk_resource_is_managed(NULL));
21 }
22
23 static void
24 resource_is_managed(void **state)
25 {
26 pcmk_resource_t rsc1 = {
27 .flags = pcmk_rsc_managed,
28 };
29
30 assert_true(pcmk_resource_is_managed(&rsc1));
31 }
32
33 static void
34 resource_is_not_managed(void **state)
35 {
36 pcmk_resource_t rsc1 = {
37 .flags = 0,
38 };
39
40 assert_false(pcmk_resource_is_managed(&rsc1));
41 }
42
43 PCMK__UNIT_TEST(NULL, NULL,
44 cmocka_unit_test(null_resource),
45 cmocka_unit_test(resource_is_managed),
46 cmocka_unit_test(resource_is_not_managed))