diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dirent.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/dirent.c b/tests/dirent.c index de20b86..bb84cf5 100644 --- a/tests/dirent.c +++ b/tests/dirent.c @@ -40,8 +40,9 @@ main() }; char name[9]; char pref[4]; + char *full_name; - puts("1..2"); + puts("1..4"); if (opkg_opk_dirent_name_prefix(&baz, 0, name, sizeof(name), pref, sizeof(pref)) != OPKG_OPK_OK || @@ -59,5 +60,19 @@ main() } printf("ok 2 - \"%s\" + \"%s\"\n", pref, name); + full_name = opkg_opk_dirent_name_alloc(&baz, 0); + if (full_name == NULL || strcmp(full_name, "foo/bar/baz") != 0) { + fputs("not ", stdout); + } + printf("ok 3 - \"%s\"\n", full_name); + free(full_name); + + full_name = opkg_opk_dirent_name_alloc(&baz, 1); + if (full_name == NULL || strcmp(full_name, "foo/bar/baz/") != 0) { + fputs("not ", stdout); + } + printf("ok 4 - \"%s\"\n", full_name); + free(full_name); + return EXIT_SUCCESS; } |