pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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
16
17static void
18null_resource(void **state)
19{
20 assert_null(pcmk_resource_id(NULL));
21}
22
23static void
24resource_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
34PCMK__UNIT_TEST(NULL, NULL,
35 cmocka_unit_test(null_resource),
36 cmocka_unit_test(resource_with_id))
Scheduler API for resources.
const char * pcmk_resource_id(const pcmk_resource_t *rsc)
Definition resources.c:43
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)