pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
pcmk__s_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 
13 
14 static void
15 s_is_null(void **state) {
16  assert_null(pcmk__s(NULL, NULL));
17  assert_string_equal(pcmk__s(NULL, ""), "");
18  assert_string_equal(pcmk__s(NULL, "something"), "something");
19 }
20 
21 static void
22 s_is_not_null(void **state) {
23  assert_string_equal(pcmk__s("something", NULL), "something");
24  assert_string_equal(pcmk__s("something", "default"), "something");
25 }
26 
27 PCMK__UNIT_TEST(NULL, NULL,
28  cmocka_unit_test(s_is_null),
29  cmocka_unit_test(s_is_not_null))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)