From 954a534bc0e7f30e66cc7dfd15ac79544e92671f Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 7 Apr 2019 13:08:40 +0100 Subject: [PATCH] remove vpath test for user dir the test was broken and fixing is insane so this test fails on windows as getuid isn't there... so this fixes the windows bild: fix T7728 ... but it also would have failed if $HOME didn't match what was in the passwd file, and other fallback cases if they were triggered. but ... to make this test stay it would have to also change the logic - check $HOME env first, then pwent entry, if that fails /tmp/UID and if that fails use /tmp ... the test would effectively be a copy & paste of the vpath code at which point this is really pointless where testing is copying the exact (or almost exat) same code into the test. this is ignoring the #ifdef fun of martching ifdefs that vary on windows. the problem is this kind of api is defined very much by the system it runs on and the environment and situation, so the test has to be as complex. realistically, instead of copying & pasting the code across and now having 2 bits of code to possibly mantain (change the lib src then the test needs changes too as it's a copy & paste), it's just saner not to have a test for this kind of siutation and accept the reality of the situation. @fix --- src/tests/eina/eina_test_vpath.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/tests/eina/eina_test_vpath.c b/src/tests/eina/eina_test_vpath.c index e5747b942f..851c47ee2b 100644 --- a/src/tests/eina/eina_test_vpath.c +++ b/src/tests/eina/eina_test_vpath.c @@ -50,24 +50,9 @@ EFL_START_TEST(eina_test_vpath_snprintf) } EFL_END_TEST -EFL_START_TEST(eina_test_vpath_user) -{ - char buf[PATH_MAX]; - char cmp[PATH_MAX]; - struct passwd *pwent; - - pwent = getpwuid(getuid()); - - eina_vpath_resolve_snprintf(buf, sizeof(buf), "~%s/foo/bar/king/kong/", pwent->pw_name); - snprintf(cmp, sizeof(cmp), "%s/foo/bar/king/kong/", pwent->pw_dir); - ck_assert_str_eq(buf, cmp); -} -EFL_END_TEST - void eina_test_vpath(TCase *tc) { tcase_add_test(tc, eina_test_vpath_invalid); tcase_add_test(tc, eina_test_vpath_valid); tcase_add_test(tc, eina_test_vpath_snprintf); - tcase_add_test(tc, eina_test_vpath_user); }