Module Name: src Committed By: martin Date: Sun Oct 13 10:46:03 UTC 2024
Modified Files: src/tests/lib/libc/c063 [netbsd-10]: t_fchmodat.c t_utimensat.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #956): tests/lib/libc/c063/t_fchmodat.c: revision 1.4 tests/lib/libc/c063/t_fchmodat.c: revision 1.5 tests/lib/libc/c063/t_fchmodat.c: revision 1.6 tests/lib/libc/c063/t_fchmodat.c: revision 1.7 tests/lib/libc/c063/t_utimensat.c: revision 1.7 Fix = -> ==. Pointed out by Shivraj tests/libc: replace some more '=' with the intended '==' correct test conditions. tests/fchmodat: add missing space in test failure message To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.22.1 src/tests/lib/libc/c063/t_fchmodat.c cvs rdiff -u -r1.6 -r1.6.22.1 src/tests/lib/libc/c063/t_utimensat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/c063/t_fchmodat.c diff -u src/tests/lib/libc/c063/t_fchmodat.c:1.3 src/tests/lib/libc/c063/t_fchmodat.c:1.3.22.1 --- src/tests/lib/libc/c063/t_fchmodat.c:1.3 Tue Jan 10 15:13:56 2017 +++ src/tests/lib/libc/c063/t_fchmodat.c Sun Oct 13 10:46:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $ */ +/* $NetBSD: t_fchmodat.c,v 1.3.22.1 2024/10/13 10:46:02 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_fchmodat.c,v 1.3 2017/01/10 15:13:56 christos Exp $"); +__RCSID("$NetBSD: t_fchmodat.c,v 1.3.22.1 2024/10/13 10:46:02 martin Exp $"); #include <sys/param.h> #include <sys/stat.h> @@ -49,6 +49,11 @@ __RCSID("$NetBSD: t_fchmodat.c,v 1.3 201 #define BASELINK "symlink" #define FILEERR "dir/fchmodaterr" +#define modecheck(a, b) \ + ATF_REQUIRE_MSG(((a) & ALLPERMS) == (b), \ + "Incorrect mode found %#o != expected %#o", \ + ((a) & ALLPERMS), (b)); + ATF_TC(fchmodat_fd); ATF_TC_HEAD(fchmodat_fd, tc) { @@ -69,7 +74,7 @@ ATF_TC_BODY(fchmodat_fd, tc) ATF_REQUIRE(close(dfd) == 0); ATF_REQUIRE(stat(FILE, &st) == 0); - ATF_REQUIRE(st.st_mode = 0600); + modecheck(st.st_mode, 0600); } ATF_TC(fchmodat_fdcwd); @@ -91,7 +96,7 @@ ATF_TC_BODY(fchmodat_fdcwd, tc) ATF_REQUIRE(fchmodat(AT_FDCWD, BASEFILE, 0600, 0) == 0); ATF_REQUIRE(stat(BASEFILE, &st) == 0); - ATF_REQUIRE(st.st_mode = 0600); + modecheck(st.st_mode, 0600); } ATF_TC(fchmodat_fdcwderr); @@ -173,14 +178,14 @@ ATF_TC_BODY(fchmodat_fdlink, tc) ATF_REQUIRE((dfdlink = open(DIR, O_RDONLY, 0)) != -1); ATF_REQUIRE(fchmodat(dfdlink, BASELINK, 0600, 0) == -1); - ATF_REQUIRE(errno = ENOENT); + ATF_REQUIRE(errno == ENOENT); ATF_REQUIRE(fchmodat(dfdlink, BASELINK, 0600, AT_SYMLINK_NOFOLLOW) == 0); ATF_REQUIRE(close(dfdlink) == 0); ATF_REQUIRE(lstat(LINK, &st) == 0); - ATF_REQUIRE(st.st_mode = 0600); + modecheck(st.st_mode, 0600); } ATF_TP_ADD_TCS(tp) Index: src/tests/lib/libc/c063/t_utimensat.c diff -u src/tests/lib/libc/c063/t_utimensat.c:1.6 src/tests/lib/libc/c063/t_utimensat.c:1.6.22.1 --- src/tests/lib/libc/c063/t_utimensat.c:1.6 Tue Jan 10 15:13:56 2017 +++ src/tests/lib/libc/c063/t_utimensat.c Sun Oct 13 10:46:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: t_utimensat.c,v 1.6 2017/01/10 15:13:56 christos Exp $ */ +/* $NetBSD: t_utimensat.c,v 1.6.22.1 2024/10/13 10:46:02 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_utimensat.c,v 1.6 2017/01/10 15:13:56 christos Exp $"); +__RCSID("$NetBSD: t_utimensat.c,v 1.6.22.1 2024/10/13 10:46:02 martin Exp $"); #include <sys/param.h> #include <sys/stat.h> @@ -185,7 +185,7 @@ ATF_TC_BODY(utimensat_fdlink, tc) ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1); ATF_REQUIRE(utimensat(dfd, BASELINK, tptr, 0) == -1); - ATF_REQUIRE(errno = ENOENT); + ATF_REQUIRE(errno == ENOENT); ATF_REQUIRE(utimensat(dfd, BASELINK, tptr, AT_SYMLINK_NOFOLLOW) == 0);