This source file includes following definitions.
- s_is_null
- s_is_not_null
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
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))