pacemaker
2.1.8-3980678f03
Scalable High-Availability cluster resource manager
lib
common
tests
resources
pcmk_resource_id_test.c
Go to the documentation of this file.
1
/*
2
* Copyright 2024 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 <stdio.h>
// NULL
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))
resources.h
Scheduler API for resources.
PCMK__UNIT_TEST
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
Definition:
unittest_internal.h:196
pe_resource_s
Definition:
resources.h:392
crm_internal.h
rsc1
pcmk_resource_t rsc1
Definition:
pe__cmp_rsc_priority_test.c:17
pcmk_resource_id
const char * pcmk_resource_id(const pcmk_resource_t *rsc)
Definition:
resources.c:27
unittest_internal.h
pe_resource_s::id
char * id
Definition:
resources.h:395
Generated on Thu Aug 8 2024 18:08:10 for pacemaker by
1.8.14