summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-11-03 12:37:17 +0100
committerStefan Schmidt <stefan@osg.samsung.com>2015-11-03 12:50:50 +0100
commitc74e03fda48a5f44dfc3c43b2ad17f4fc9e90490 (patch)
treecd793b31cfcc44bc3ce878eb1d7afe0524766a02
parentae5e2c82843a5dea2474b79f5426207495b465a8 (diff)
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.
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con.c b/src/tests/ecore_con/ecore_con_test_ecore_con.c
index 249f39ed8c..d7f03e6485 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con.c
@@ -335,7 +335,7 @@ START_TEST(ecore_test_ecore_con_local_user_home)
335 335
336 unsetenv("XDG_RUNTIME_DIR"); 336 unsetenv("XDG_RUNTIME_DIR");
337 _ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_soc", EINA_FALSE, 12345); 337 _ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_soc", EINA_FALSE, 12345);
338 setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1); 338 if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
339} 339}
340END_TEST 340END_TEST
341 341
@@ -347,8 +347,8 @@ START_TEST(ecore_test_ecore_con_local_user_tmp)
347 unsetenv("XDG_RUNTIME_DIR"); 347 unsetenv("XDG_RUNTIME_DIR");
348 unsetenv("HOME"); 348 unsetenv("HOME");
349 _ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_sock", EINA_FALSE, 12345); 349 _ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_sock", EINA_FALSE, 12345);
350 setenv("HOME", homedir, 1); 350 if (homedir) setenv("HOME", homedir, 1);
351 setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1); 351 if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
352} 352}
353END_TEST 353END_TEST
354 354