Lines Matching refs:nftw64
25 * test64.c - Test functions for nftw64()
28 #include "nftw64.h"
39 * A call to int nftw64(const char *path, int (*fn)(const char *, const
51 fprintf(temp, "TEST: nftw64() succeeds\n");
55 if ((ret = nftw64("./tmp/data/dirh", test_func1, MAX_FD, 0)) == -1) {
56 perror("ERROR: nftw64 failed");
100 * A call to int nftw64(const char *path, int (*fn)(const char *, const
112 "TEST: nftw64 with FTW_PHYS does not follow symbolic links\n");
116 if ((ret = nftw64("./tmp/data/dirl", test_func1, MAX_FD, FTW_PHYS))
118 perror("nftw64");
130 "ERROR: Expected %d files to be visited. nftw64() visited %d\n",
144 * A call to int nftw64(const char *path, int (*fn)(const char *, const
156 fprintf(temp, "TEST: nftw64 without FTW_PHYS follows symbolic links\n");
161 if ((ret = nftw64("./tmp/data/dirl", test_func3, MAX_FD, 0)) == -1) {
162 perror("nftw64");
173 "ERROR: Expected %d files to be visited. nftw64() visited %d\n",
182 * A call to int nftw64(const char *path, int (*fn)(const char *, const
199 if ((ret_val = nftw64(path, test_func4, MAX_FD, FTW_DEPTH)) == -1) {
200 perror("nftw64");
219 * A call to int nftw64(const char *path, int (*fn)(const char *, const
236 if ((ret_val = nftw64(path, test_func4, MAX_FD, 0)) == -1) {
237 perror("nftw64");
256 * A call to int nftw64(const char *path, int (*fn)(const char *, const
277 "TEST: nftw64 with FTW_CHDIR changes to each dir before reporting files in it\n");
280 ret_val = nftw64(path, test_func5, MAX_FD, FTW_CHDIR);
282 perror("nftw64");
294 * A call to int nftw64(const char *path, int (*fn)(const char *, const
307 "TEST: nftw64 passes pathname as first argument to fn()\n");
310 if ((ret = nftw64("./tmp/data/dirg", test_func7, MAX_FD, 0)) == -1) {
311 perror("nftw64");
324 * A call to int nftw64(const char *path, int (*fn)(const char *, const
337 "TEST: nftw64 passes stat struct as second argument to fn()\n");
340 if ((ret = nftw64("./tmp/data/dirg", test_func8, MAX_FD, 0)) == -1) {
341 perror("nftw64");
354 * A call to int nftw64(const char *path, int (*fn)(const char *, const
367 "TEST: nftw64 passes FTW_F as third arg to fn() for files\n");
370 if ((ret = nftw64("./tmp/data/dirg", test_func9, MAX_FD, FTW_PHYS))
372 perror("nftw64");
385 * A call to int nftw64(const char *path, int (*fn)(const char *, const
398 "TEST: nftw64 passes FTW_D as third arg to fn() when file is directory\n");
401 if ((ret = nftw64("./tmp/data/dirg", test_func10, MAX_FD, FTW_PHYS))
403 perror("nftw64");
416 * A call to int nftw64(const char *path, int (*fn)(const char *, const
433 "TEST: nftw64 passes FTW_DP when file is directory and subdirs already visited\n");
436 if ((ret = nftw64("./tmp/data/dirg", test_func11, MAX_FD, FTW_DEPTH |
438 perror("nftw64");
451 * A call to int nftw64(const char *path, int (*fn)(const char *, const
464 "TEST: nftw64 wth FTW_PHYS passes FTW_SL when file is symlink\n");
466 if ((ret = nftw64("./tmp/data/dirg", test_func12, MAX_FD, FTW_PHYS))
468 perror("nftw64");
481 * A call to int nftw64(const char *path, int (*fn)(const char *, const
503 fprintf(temp, "TEST: nftw64 with FTW_PHYS passes FTW_SLN when file");
507 if ((ret = nftw64("./tmp/data/dirg", test_func13, MAX_FD, FTW_PHYS))
509 perror("nftw64");
522 * A call to int nftw64(const char *path, int (*fn)(const char *, const
535 "TEST: nftw64 passes FTW_DNR when file is directory that cannot be read\n");
538 if ((ret = nftw64("./tmp/data/d333", test_func14, MAX_FD, 0)) == -1) {
539 perror("nftw64");
552 * A call to int nftw64(const char *path, int (*fn)(const char *, const
565 "TEST: nftw64(path, fn, depth, FTW_PHYS) passes FTW_NS when dir unsearchable\n");
568 if ((ret = nftw64("./tmp/data/d666", test_func15, MAX_FD, FTW_PHYS))
570 perror("nftw64");
583 * A call to int nftw64(const char *path, int (*fn)(const char *, const
605 fprintf(temp, "TEST: nftw64 with absolute pathname %s\n", path);
608 if ((s2 = nftw64(path, test_func16, MAX_FD, 0)) == -1) {
609 perror("nftw64");
621 fprintf(temp, "TEST: nftw64 with relative pathname %s\n", path);
624 if ((s2 = nftw64(path, test_func16, MAX_FD, 0)) == -1) {
625 perror("nftw64");
638 * A call to int nftw64(const char *path, int (*fn)(const char *, const
652 fprintf(temp, "TEST: nftw64 with FTW_PHYS passes FTW_SL for symlink\n");
655 if ((ret = nftw64("./tmp/data/dirl", test_func17, MAX_FD, FTW_PHYS))
657 perror("nftw64");
662 fprintf(temp, "ERROR: nftw64() failed to find symbolic link\n");
671 "TEST: nftw64 without FTW_PHYS does not pass FTW_SL for symlink\n");
674 if ((ret = nftw64("./tmp/data/dirl", test_func17, MAX_FD, 0)) == -1) {
675 perror("nftw64");
680 fprintf(temp, "ERROR: nftw64() found symbolic link\n");
688 * A call to int nftw64(const char *path, int (*fn)(const char *, const
704 fprintf(temp, "TEST: nftw64
707 if ((ret = nftw64("./tmp/data/dirg", test_func18, MAX_FD, FTW_PHYS))
709 perror("nftw64");
714 fprintf(temp, "ERROR: nftw64() passed FTW_SLN\n");
722 fprintf(temp, "TEST: nftw64 without FTW_PHYS passes FTW_SLN\n");
725 if ((ret = nftw64("./tmp/data/dirg", test_func18, MAX_FD, 0)) == -1) {
726 perror("nftw64");
736 fprintf(temp, "ERROR: nftw64 passed FTW_SLN but did");
742 fprintf(temp, "ERROR: nftw64() did not pass FTW_SLN\n");
750 * On a call to int nftw64(const char *path, int (*fn)(const char *, const
768 ret_val = nftw64("./tmp/data/d333", test_func19, MAX_FD, 0);
770 perror("nftw64");
794 * A call to int nftw64(const char *path, int (*fn)(const char *, const
821 if (nftw64("./tmp/data/dirh", test_func20, 1, 0) == -1) {
822 perror("nftw64");
835 "nftw64 did not close all file descriptors used in traversal\n",
850 * On a call to int nftw64(const char *path, int (*fn)(const char *, const
893 ret_val = nftw64(path, test_func21, 1, 0);
895 perror("nftw64");
908 * A call to int nftw64(const char *path, int (*fn)(const char *, const
942 ret_val = nftw64(path, test_func22, MAX_FD, 0);
945 perror("nftw64");
958 * A call to int nftw64(const char *path, int (*fn)(const char *, const
973 "TEST: The function nftw64 should return with value set by fn\n");
976 if ((ret = nftw64("./tmp/data/dirh", test_func23, MAX_FD, FTW_PHYS))
978 perror("nftw64");
985 "ERROR: nftw64 did not return value returned by fn()\n");
991 "ERROR: nftw64() did not return immediately on non-zero fn() return\n");
999 * ENAMETOOLONG in errno and return -1 on a call to int nftw64(const char
1006 test_ENAMETOOLONG_path("nftw64", callback, -1);
1011 * ENAMETOOLONG in errno and return -1 on a call to int nftw64(const char
1018 test_ENAMETOOLONG_name("nftw64", callback, -1);
1023 * ENOENT in errno and return -1 on a call to int nftw64(const char *path,
1032 fprintf(temp, "TEST: [ENOENT] && -1 returned by nftw64\n");
1035 test_ENOENT_nofile("nftw64", callback, -1);
1040 * ENOENT in errno and return -1 on a call to int nftw64(const char *path,
1049 fprintf(temp, "TEST: The function nftw64 should return with a -1\n");
1052 test_ENOENT_empty("nftw64", callback, -1);
1057 * ENOTDIR in errno and return -1 on a call to int nftw64(const char
1066 fprintf(temp, "TEST: [ENOTDIR] && -1 returned by nftw64\n");
1069 test_ENOTDIR("nftw64", callback, -1);
1074 * EACCES in errno and return -1 on a call to int nftw64(const char *path,
1090 fprintf(temp, "TEST: [EACCES] && -1 returned by nftw64\n");
1093 test_ENOTDIR("nftw64", callback, -1);
1098 * EACCES in errno and return -1 on a call to int nftw64(const char *path,
1113 fprintf(temp, "TEST: [EACCES] && -1 returned by nftw64\n");
1116 test_ENOTDIR("nftw64", callback, -1);