This source file includes following definitions.
- pcmk__getpid_s_test
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
13
14 #include "mock_private.h"
15
16 #include <sys/types.h>
17 #include <unistd.h>
18
19 static void
20 pcmk__getpid_s_test(void **state)
21 {
22 char *retval;
23
24
25 pcmk__mock_getpid = true;
26 will_return(__wrap_getpid, 1234);
27
28 retval = pcmk__getpid_s();
29 assert_non_null(retval);
30 assert_string_equal("1234", retval);
31
32 free(retval);
33
34 pcmk__mock_getpid = false;
35 }
36
37 PCMK__UNIT_TEST(NULL, NULL,
38 cmocka_unit_test(pcmk__getpid_s_test))