forked from enlightenment/efl
Revert "remove vpath test for user dir the test was broken and fixing is insane"
Summary:
This reverts commit 954a534bc0
.
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
This commit is contained in:
parent
b050294635
commit
f417fb26e8
|
@ -61,9 +61,26 @@ EFL_START_TEST(eina_test_vpath_snprintf)
|
|||
}
|
||||
EFL_END_TEST
|
||||
|
||||
EFL_START_TEST(eina_test_vpath_user)
|
||||
{
|
||||
#ifdef HAVE_GETPWENT
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue