pacemaker
2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
lib
common
tests
utils
crm_meta_name_test.c
Go to the documentation of this file.
1
/*
2
* Copyright 2022 the Pacemaker project contributors
3
*
4
* The version control history for this file may have further details.
5
*
6
* This source code is licensed under the GNU General Public License version 2
7
* or later (GPLv2+) WITHOUT ANY WARRANTY.
8
*/
9
10
#include <
crm_internal.h
>
11
12
#include <
crm/common/unittest_internal.h
>
13
#include <
crm/msg_xml.h
>
14
15
static
void
16
empty_params(
void
**state)
17
{
18
assert_null(
crm_meta_name
(NULL));
19
}
20
21
static
void
22
standard_usage(
void
**state)
23
{
24
char
*s = NULL;
25
26
s =
crm_meta_name
(
XML_RSC_ATTR_NOTIFY
);
27
assert_string_equal(s,
"CRM_meta_notify"
);
28
free(s);
29
30
s =
crm_meta_name
(
XML_RSC_ATTR_STICKINESS
);
31
assert_string_equal(s,
"CRM_meta_resource_stickiness"
);
32
free(s);
33
34
s =
crm_meta_name
(
"blah"
);
35
assert_string_equal(s,
"CRM_meta_blah"
);
36
free(s);
37
}
38
39
PCMK__UNIT_TEST
(NULL, NULL,
40
cmocka_unit_test(empty_params),
41
cmocka_unit_test(standard_usage))
XML_RSC_ATTR_STICKINESS
#define XML_RSC_ATTR_STICKINESS
Definition:
msg_xml.h:252
PCMK__UNIT_TEST
PCMK__UNIT_TEST(NULL, NULL, cmocka_unit_test(bad_input), cmocka_unit_test(not_found), cmocka_unit_test(find_attrB), cmocka_unit_test(find_attrA_matching))
crm_meta_name
char * crm_meta_name(const char *field)
Definition:
utils.c:468
crm_internal.h
XML_RSC_ATTR_NOTIFY
#define XML_RSC_ATTR_NOTIFY
Definition:
msg_xml.h:251
msg_xml.h
unittest_internal.h
Generated on Tue Dec 19 2023 17:32:56 for pacemaker by
1.8.14