jayji pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5b8315aeffb6a568d0b70441a2d05f6de2bf8fe1
commit 5b8315aeffb6a568d0b70441a2d05f6de2bf8fe1 Author: Jean Guyomarc'h <[email protected]> Date: Mon Aug 29 15:53:50 2016 +0200 ecore-tests: make sure we always get a canonical path There may be extraneous slashes that are contained in the returned generated directories (because they were put there in environment variables). Since we test with string comparison, some tests would fail due to different environment setups. --- src/tests/ecore/ecore_test_ecore_file.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/tests/ecore/ecore_test_ecore_file.c b/src/tests/ecore/ecore_test_ecore_file.c index cb3928a..ba82223 100644 --- a/src/tests/ecore/ecore_test_ecore_file.c +++ b/src/tests/ecore/ecore_test_ecore_file.c @@ -32,35 +32,33 @@ _writeToFile(const char *filePath, char *text) fclose(f); } -static Eina_Tmpstr* +static char * get_tmp_dir(void) { Eina_Tmpstr *tmp_dir; + char *realpath; Eina_Bool created = eina_file_mkdtemp("EcoreFileTestXXXXXX", &tmp_dir); + if (!created) return NULL; - if (!created) - { - return NULL; - } - - return tmp_dir; + realpath = ecore_file_realpath(tmp_dir); + eina_tmpstr_del(tmp_dir); + return realpath; } -static Eina_Tmpstr* +static char * get_tmp_file(void) { Eina_Tmpstr *tmp_file; + char *realpath; int fd = eina_file_mkstemp("EcoreFileTestXXXXXX", &tmp_file); - - if (fd < 0) - { - return NULL; - } - + if (fd < 0) return NULL; close(fd); - return tmp_file; + + realpath = ecore_file_realpath(tmp_file); + eina_tmpstr_del(tmp_file); + return realpath; } static void @@ -147,7 +145,7 @@ START_TEST(ecore_test_ecore_file_operations) Eina_Bool res; Eina_List *list; - tmpdir = eina_environment_tmp_get(); + tmpdir = ecore_file_realpath(eina_environment_tmp_get()); ret = ecore_file_init(); fail_if(ret != 1); --
