This source file includes following definitions.
- all_params_null
- some_params_null
- no_params_null
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/common/agents.h>
14
15 static void
16 all_params_null(void **state) {
17 assert_null(crm_generate_ra_key(NULL, NULL, NULL));
18 }
19
20 static void
21 some_params_null(void **state) {
22 char *retval;
23
24 assert_null(crm_generate_ra_key("std", "prov", NULL));
25
26 retval = crm_generate_ra_key("std", NULL, "ty");
27 assert_string_equal(retval, "std:ty");
28 free(retval);
29
30 assert_null(crm_generate_ra_key(NULL, "prov", "ty"));
31 assert_null(crm_generate_ra_key("std", NULL, NULL));
32 assert_null(crm_generate_ra_key(NULL, "prov", NULL));
33 assert_null(crm_generate_ra_key(NULL, NULL, "ty"));
34 }
35
36 static void
37 no_params_null(void **state) {
38 char *retval;
39
40 retval = crm_generate_ra_key("std", "prov", "ty");
41 assert_string_equal(retval, "std:prov:ty");
42 free(retval);
43 }
44
45 PCMK__UNIT_TEST(NULL, NULL,
46 cmocka_unit_test(all_params_null),
47 cmocka_unit_test(some_params_null),
48 cmocka_unit_test(no_params_null))