Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/syscall Remove the dirent(3) check entirely.



details:   https://anonhg.NetBSD.org/src/rev/2f5bb459ad48
branches:  trunk
changeset: 765762:2f5bb459ad48
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Jun 05 13:49:46 2011 +0000

description:
Remove the dirent(3) check entirely.

diffstat:

 tests/syscall/t_stat.c |  23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)

diffs (59 lines):

diff -r 495cc5a36c26 -r 2f5bb459ad48 tests/syscall/t_stat.c
--- a/tests/syscall/t_stat.c    Sun Jun 05 09:37:10 2011 +0000
+++ b/tests/syscall/t_stat.c    Sun Jun 05 13:49:46 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_stat.c,v 1.2 2011/06/04 15:45:55 jruoho Exp $ */
+/* $NetBSD: t_stat.c,v 1.3 2011/06/05 13:49:46 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,13 +29,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_stat.c,v 1.2 2011/06/04 15:45:55 jruoho Exp $");
+__RCSID("$NetBSD: t_stat.c,v 1.3 2011/06/05 13:49:46 jruoho Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
 
 #include <atf-c.h>
-#include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <fts.h>
@@ -88,11 +87,9 @@
 {
        const short depth = 3;
        struct stat sa, sb;
-       struct dirent *dr;
        char *argv[2];
        FTSENT *ftse;
        FTS *fts;
-       DIR *dir;
        int ops;
 
        argv[1] = NULL;
@@ -139,22 +136,6 @@
                        if (sb.st_ino != ftse->fts_statp->st_ino)
                                atf_tc_fail("stat(2) and fts(3) differ");
 
-                       /*
-                        * Verify that the last stat(2) call
-                        * matches the corresponding dirent(3).
-                        */
-                       dir = opendir(ftse->fts_path);
-                       ATF_REQUIRE(dir != NULL);
-
-                       dr = readdir(dir);
-
-                       if (dr == NULL)
-                               break;
-
-                       if (sb.st_ino != dr->d_fileno)
-                               atf_tc_fail("stat(2) and readdir(3) differ");
-
-                       ATF_REQUIRE(closedir(dir) == 0);
                        break;
 
                default:



Home | Main Index | Thread Index | Old Index