tests/ecore_con: check saved env variables before setting them again.

We see segfaults on Jenkins with these two test cases. Better check
before setting them as we had similar problems before on this setup
as XDG_RUNTIME_DIR might never be set.
This commit is contained in:
Stefan Schmidt 2015-11-03 12:37:17 +01:00
parent ae5e2c8284
commit c74e03fda4
1 changed files with 3 additions and 3 deletions

View File

@ -335,7 +335,7 @@ START_TEST(ecore_test_ecore_con_local_user_home)
unsetenv("XDG_RUNTIME_DIR");
_ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_soc", EINA_FALSE, 12345);
setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
}
END_TEST
@ -347,8 +347,8 @@ START_TEST(ecore_test_ecore_con_local_user_tmp)
unsetenv("XDG_RUNTIME_DIR");
unsetenv("HOME");
_ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_sock", EINA_FALSE, 12345);
setenv("HOME", homedir, 1);
setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
if (homedir) setenv("HOME", homedir, 1);
if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
}
END_TEST