From: Mark Wielaard Date: Tue, 3 Feb 2026 18:28:46 +0000 (+0100) Subject: Fix asserts in testcases close_range, bug514094 and readlinkat_self. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76391e9987212f6e4d5c2574f56c60c690ce6ced;p=thirdparty%2Fvalgrind.git Fix asserts in testcases close_range, bug514094 and readlinkat_self. These tests did an assert (errno = EFAULT) instead of an assert on errno == EFAULT. close_range was also using an valid flag 2 (CLOSE_RANGE_UNSHARE) instead of a bad one. --- diff --git a/memcheck/tests/close_range.c b/memcheck/tests/close_range.c index 5c21e7f42..93e840072 100644 --- a/memcheck/tests/close_range.c +++ b/memcheck/tests/close_range.c @@ -60,13 +60,13 @@ int main(void) errno = 0; // bad flag - close_range(fd1, fd3, 2); - assert(errno = EINVAL); + close_range(fd1, fd3, 231); + assert(errno == EINVAL); errno = 0; // wrong order close_range(fd3, fd1, 0); - assert(errno = EINVAL); + assert(errno == EINVAL); errno = 0; getrlimit(RLIMIT_NOFILE, &rl); diff --git a/none/tests/bug514094.c b/none/tests/bug514094.c index a62a6406b..6a45f0949 100644 --- a/none/tests/bug514094.c +++ b/none/tests/bug514094.c @@ -43,6 +43,6 @@ int main(int argc, char** argv) ret = readlink("/proc/self/exe", (char*)1, 100); #endif assert(ret == -1); - assert(errno = EFAULT); + assert(errno == EFAULT); } diff --git a/none/tests/linux/readlinkat_self.c b/none/tests/linux/readlinkat_self.c index 586581a0d..ded4c796b 100644 --- a/none/tests/linux/readlinkat_self.c +++ b/none/tests/linux/readlinkat_self.c @@ -29,6 +29,6 @@ int main(int argc, char** argv) ret = readlinkat(101, "/proc/self/exe", (char*)1, 100); assert(ret == -1); - assert(errno = EFAULT); + assert(errno == EFAULT); }