21 #include <sys/utsname.h> 26 int retval = mock_type(
int);
29 strcpy(buf->nodename, mock_ptr_type(
char *));
36 uname_succeeded_test(
void **state)
44 assert_non_null(retval);
45 assert_string_equal(
"somename", retval);
51 uname_failed_test(
void **state)
62 main(
int argc,
char **argv)
64 const struct CMUnitTest tests[] = {
65 cmocka_unit_test(uname_succeeded_test),
66 cmocka_unit_test(uname_failed_test),
69 cmocka_set_message_output(CM_OUTPUT_TAP);
70 return cmocka_run_group_tests(tests, NULL, NULL);
int main(int argc, char **argv)
char * pcmk_hostname(void)
Get the local hostname.
int __wrap_uname(struct utsname *buf)