summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-15 09:49:48 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-15 09:49:48 -0400
commitf417fb26e88c10afec74a09a3f0b93b97c143b48 (patch)
tree9bfe1a65b0c01ed9c51d9d654166c9fc6f512e12 /src
parentb050294635d5104decb6d0cbad271ba507ce2d4a (diff)
Revert "remove vpath test for user dir the test was broken and fixing is insane"
Summary: This reverts commit 954a534bc0e7f30e66cc7dfd15ac79544e92671f. It appears that the concerns from this commit are invalid. The case of ~asdf/ does not have any fallback case, if there is no getpwent on this system, then there will be simply an error, same for the case of a missing user. In such a case nothing will be written in the buffer / returned by eina_vpath. The windows build problem can be fixed by a simple #ifdef'ing the test code. Reviewers: raster, zmike, cedric, vtorri Reviewed By: vtorri Subscribers: vtorri, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8671
Diffstat (limited to 'src')
-rw-r--r--src/tests/eina/eina_test_vpath.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_vpath.c b/src/tests/eina/eina_test_vpath.c
index cad61bd831..7a38712acc 100644
--- a/src/tests/eina/eina_test_vpath.c
+++ b/src/tests/eina/eina_test_vpath.c
@@ -61,9 +61,26 @@ EFL_START_TEST(eina_test_vpath_snprintf)
61} 61}
62EFL_END_TEST 62EFL_END_TEST
63 63
64EFL_START_TEST(eina_test_vpath_user)
65{
66#ifdef HAVE_GETPWENT
67 char buf[PATH_MAX];
68 char cmp[PATH_MAX];
69 struct passwd *pwent;
70
71 pwent = getpwuid(getuid());
72
73 eina_vpath_resolve_snprintf(buf, sizeof(buf), "~%s/foo/bar/king/kong/", pwent->pw_name);
74 snprintf(cmp, sizeof(cmp), "%s/foo/bar/king/kong/", pwent->pw_dir);
75 ck_assert_str_eq(buf, cmp);
76#endif
77}
78EFL_END_TEST
79
64void eina_test_vpath(TCase *tc) 80void eina_test_vpath(TCase *tc)
65{ 81{
66 tcase_add_test(tc, eina_test_vpath_invalid); 82 tcase_add_test(tc, eina_test_vpath_invalid);
67 tcase_add_test(tc, eina_test_vpath_valid); 83 tcase_add_test(tc, eina_test_vpath_valid);
68 tcase_add_test(tc, eina_test_vpath_snprintf); 84 tcase_add_test(tc, eina_test_vpath_snprintf);
85 tcase_add_test(tc, eina_test_vpath_user);
69} 86}