This source file includes following definitions.
- empty_params
- standard_usage
- main
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11 #include <crm/msg_xml.h>
12
13 #include <stdarg.h>
14 #include <stddef.h>
15 #include <stdint.h>
16 #include <setjmp.h>
17 #include <cmocka.h>
18
19 static void
20 empty_params(void **state)
21 {
22 assert_null(crm_meta_name(NULL));
23 }
24
25 static void
26 standard_usage(void **state)
27 {
28 char *s = NULL;
29
30 s = crm_meta_name(XML_RSC_ATTR_NOTIFY);
31 assert_string_equal(s, "CRM_meta_notify");
32 free(s);
33
34 s = crm_meta_name(XML_RSC_ATTR_STICKINESS);
35 assert_string_equal(s, "CRM_meta_resource_stickiness");
36 free(s);
37
38 s = crm_meta_name("blah");
39 assert_string_equal(s, "CRM_meta_blah");
40 free(s);
41 }
42
43 int main(int argc, char **argv)
44 {
45 const struct CMUnitTest tests[] = {
46 cmocka_unit_test(empty_params),
47 cmocka_unit_test(standard_usage),
48 };
49
50 cmocka_set_message_output(CM_OUTPUT_TAP);
51 return cmocka_run_group_tests(tests, NULL, NULL);
52 }