summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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}