22 static bool use_mocked =
false;
33 return mock_ptr_type(
char *);
40 getenv_returns_invalid(
void **state)
48 assert_string_equal(
result,
"/tmp");
52 assert_string_equal(
result,
"/tmp");
56 assert_string_equal(
result,
"/tmp");
62 getenv_returns_valid(
void **state)
70 assert_string_equal(
result,
"/var/tmp");
74 assert_string_equal(
result,
"/");
78 assert_string_equal(
result,
"/tmp/abcd.1234");
84 main(
int argc,
char **argv)
86 const struct CMUnitTest tests[] = {
87 cmocka_unit_test(getenv_returns_invalid),
88 cmocka_unit_test(getenv_returns_valid),
91 cmocka_set_message_output(CM_OUTPUT_TAP);
92 return cmocka_run_group_tests(tests, NULL, NULL);
char * __wrap_getenv(const char *name)
char * __real_getenv(const char *name)
pcmk__action_result_t result
const char * pcmk__get_tmpdir(void)
int main(int argc, char **argv)