Tests: use eina_environment_tmp_get()
authorVincent Torri <vincent dot torri at gmail dot com>
Thu, 15 Oct 2015 05:47:04 +0000 (07:47 +0200)
committerTom Hacohen <tom@stosb.com>
Thu, 15 Oct 2015 08:34:33 +0000 (09:34 +0100)
src/tests/ecore/ecore_test_ecore_file.c
src/tests/eio/eio_model_test_monitor_add.c

index 8838264..93689ac 100644 (file)
@@ -143,18 +143,7 @@ START_TEST(ecore_test_ecore_file_operations)
    Eina_Bool res;
    Eina_List *list;
 
-#ifndef HAVE_EVIL
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
-   if (getuid() == geteuid())
-#endif
-     {
-        tmpdir = getenv("TMPDIR");
-        if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR");
-     }
-   if (!tmpdir) tmpdir = "/tmp";
-#else
-   tmpdir = (char *)evil_tmpdir_get();
-#endif /* ! HAVE_EVIL */
+   tmpdir = eina_environment_tmp_get();
 
    ret = ecore_file_init();
    fail_if(ret != 1);
index 87a4ee3..8230ec2 100644 (file)
@@ -122,18 +122,7 @@ START_TEST(eio_model_test_test_monitor_add)
    fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
    fail_if(!eio_init(), "ERROR: Cannot init EIO!\n");
 
-#ifndef HAVE_EVIL
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
-   if (getuid() == geteuid())
-#endif
-     {
-        tmpdir = getenv("TMPDIR");
-        if (!tmpdir) tmpdir = getenv("XDG_RUNTIME_DIR");
-     }
-   if (!tmpdir) tmpdir = "/tmp";
-#else
-   tmpdir = (char *)evil_tmpdir_get();
-#endif /* ! HAVE_EVIL */
+   tmpdir = eina_environment_tmp_get();
    
    filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(tmpdir));
    fail_if(!filemodel, "ERROR: Cannot init model!\n");