summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-10-15 07:47:04 +0200
committerTom Hacohen <tom@stosb.com>2015-10-15 09:34:33 +0100
commit11846b406b5d037c315c2f22c9049e642c02de83 (patch)
tree18a2963ad788c1ae2b224d2e9ca0bd579ce99f88 /src
parent7b401f34dac59e118286c02fa2260c92eead2310 (diff)
Tests: use eina_environment_tmp_get()
Diffstat (limited to 'src')
-rw-r--r--src/tests/ecore/ecore_test_ecore_file.c13
-rw-r--r--src/tests/eio/eio_model_test_monitor_add.c13
2 files changed, 2 insertions, 24 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_file.c b/src/tests/ecore/ecore_test_ecore_file.c
index 8838264..93689ac 100644
--- a/src/tests/ecore/ecore_test_ecore_file.c
+++ b/src/tests/ecore/ecore_test_ecore_file.c
@@ -143,18 +143,7 @@ START_TEST(ecore_test_ecore_file_operations)
143 Eina_Bool res; 143 Eina_Bool res;
144 Eina_List *list; 144 Eina_List *list;
145 145
146#ifndef HAVE_EVIL 146 tmpdir = eina_environment_tmp_get();
147#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
148 if (getuid() == geteuid())
149#endif
150 {
151 tmpdir = getenv("TMPDIR");
152 if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR");
153 }
154 if (!tmpdir) tmpdir = "/tmp";
155#else
156 tmpdir = (char *)evil_tmpdir_get();
157#endif /* ! HAVE_EVIL */
158 147
159 ret = ecore_file_init(); 148 ret = ecore_file_init();
160 fail_if(ret != 1); 149 fail_if(ret != 1);
diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/eio_model_test_monitor_add.c
index 87a4ee3..8230ec2 100644
--- a/src/tests/eio/eio_model_test_monitor_add.c
+++ b/src/tests/eio/eio_model_test_monitor_add.c
@@ -122,18 +122,7 @@ START_TEST(eio_model_test_test_monitor_add)
122 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); 122 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
123 fail_if(!eio_init(), "ERROR: Cannot init EIO!\n"); 123 fail_if(!eio_init(), "ERROR: Cannot init EIO!\n");
124 124
125#ifndef HAVE_EVIL 125 tmpdir = eina_environment_tmp_get();
126#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
127 if (getuid() == geteuid())
128#endif
129 {
130 tmpdir = getenv("TMPDIR");
131 if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR");
132 }
133 if (!tmpdir) tmpdir = "/tmp";
134#else
135 tmpdir = (char *)evil_tmpdir_get();
136#endif /* ! HAVE_EVIL */
137 126
138 filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(tmpdir)); 127 filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(tmpdir));
139 fail_if(!filemodel, "ERROR: Cannot init model!\n"); 128 fail_if(!filemodel, "ERROR: Cannot init model!\n");