This source file includes following definitions.
- null_resource
- resource_with_id
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_null(pcmk_resource_id(NULL));
21 }
22
23 static void
24 resource_with_id(void **state)
25 {
26 char rsc1_id[] = "rsc1";
27 pcmk_resource_t rsc1 = {
28 .id = rsc1_id,
29 };
30
31 assert_string_equal(pcmk_resource_id(&rsc1), "rsc1");
32 }
33
34 PCMK__UNIT_TEST(NULL, NULL,
35 cmocka_unit_test(null_resource),
36 cmocka_unit_test(resource_with_id))