The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c4c66153243896f9de49474c817fe450584a3bf3

commit c4c66153243896f9de49474c817fe450584a3bf3
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2021-09-08 14:59:42 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2021-09-08 15:41:19 +0000

    path_test: Fix test sorting
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 tests/sys/file/path_test.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c
index 0265aa095720..ad88c691a914 100644
--- a/tests/sys/file/path_test.c
+++ b/tests/sys/file/path_test.c
@@ -63,25 +63,6 @@
 #define        CHECKED_CLOSE(fd)       \
        ATF_REQUIRE_MSG(close(fd) == 0, FMT_ERR("close"))
 
-/*
- * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd.
- * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT.
- */
-ATF_TC_WITHOUT_HEAD(path_pipe_fstatat);
-ATF_TC_BODY(path_pipe_fstatat, tc)
-{
-       struct stat sb;
-       int fd[2];
-
-       ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe"));
-       ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0,
-           FMT_ERR("fstatat pipe"));
-       ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb,
-           AT_EMPTY_PATH) == -1);
-       CHECKED_CLOSE(fd[0]);
-       CHECKED_CLOSE(fd[1]);
-}
-
 /* Create a temporary regular file containing some data. */
 static void
 mktfile(char path[PATH_MAX], const char *template)
@@ -776,6 +757,25 @@ ATF_TC_BODY(path_lock, tc)
        CHECKED_CLOSE(pathfd);
 }
 
+/*
+ * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd.
+ * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT.
+ */
+ATF_TC_WITHOUT_HEAD(path_pipe_fstatat);
+ATF_TC_BODY(path_pipe_fstatat, tc)
+{
+       struct stat sb;
+       int fd[2];
+
+       ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe"));
+       ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0,
+           FMT_ERR("fstatat pipe"));
+       ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb,
+           AT_EMPTY_PATH) == -1);
+       CHECKED_CLOSE(fd[0]);
+       CHECKED_CLOSE(fd[1]);
+}
+
 /* Verify that we can send an O_PATH descriptor over a unix socket. */
 ATF_TC_WITHOUT_HEAD(path_rights);
 ATF_TC_BODY(path_rights, tc)
@@ -890,9 +890,9 @@ ATF_TP_ADD_TCS(tp)
        ATF_TP_ADD_TC(tp, path_io);
        ATF_TP_ADD_TC(tp, path_ioctl);
        ATF_TP_ADD_TC(tp, path_lock);
+       ATF_TP_ADD_TC(tp, path_pipe_fstatat);
        ATF_TP_ADD_TC(tp, path_rights);
        ATF_TP_ADD_TC(tp, path_unix);
-       ATF_TP_ADD_TC(tp, path_pipe_fstatat);
 
        return (atf_no_error());
 }
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to