This source file includes following definitions.
- null_arguments
- standard_usage
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
13
14 static void
15 null_arguments(void **state)
16 {
17 assert_null(pcmk__failcount_name(NULL, NULL, 30000));
18 assert_null(pcmk__failcount_name("myrsc", NULL, 30000));
19 assert_null(pcmk__failcount_name(NULL, "monitor", 30000));
20 }
21
22 static void
23 standard_usage(void **state)
24 {
25 char *s = NULL;
26
27 assert_string_equal(pcmk__failcount_name("myrsc", "monitor", 30000),
28 "fail-count-myrsc#monitor_30000");
29
30 free(s);
31 }
32
33 PCMK__UNIT_TEST(NULL, NULL,
34 cmocka_unit_test(null_arguments),
35 cmocka_unit_test(standard_usage))