pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pcmk__lastfailure_name_test.c
Go to the documentation of this file.
1/*
2 * Copyright 2023 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
13
14static void
15null_arguments(void **state)
16{
17 assert_null(pcmk__lastfailure_name(NULL, NULL, 30000));
18 assert_null(pcmk__lastfailure_name("myrsc", NULL, 30000));
19 assert_null(pcmk__lastfailure_name(NULL, "monitor", 30000));
20}
21
22static void
23standard_usage(void **state)
24{
25 char *s = NULL;
26
27 assert_string_equal(pcmk__lastfailure_name("myrsc", "monitor", 30000),
28 "last-failure-myrsc#monitor_30000");
29
30 free(s);
31}
32
33PCMK__UNIT_TEST(NULL, NULL,
34 cmocka_unit_test(null_arguments),
35 cmocka_unit_test(standard_usage))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)