> * tests/test-ptsname_r.c: New file.
You are testing that the return value in case of failure is == errno.
This is not documented, neither in the glibc documentation, nor in the
Linux man page. Why should people write
if (result == EINVAL)
when they can just as well write
if (errno == EINVAL)
? The latter code is more future-proof.
Here's a suggested patch:
--- tests/test-ptsname_r.c.orig Thu Nov 10 13:52:13 2011
+++ tests/test-ptsname_r.c Thu Nov 10 12:38:25 2011
@@ -79,7 +79,6 @@
else
{
ASSERT (result != 0);
- ASSERT (result == errno);
ASSERT (errno == ERANGE);
ASSERT (buffer[0] == 'X');
}
@@ -88,7 +87,6 @@
errno = 0;
result = ptsname_r (fd, NULL, 0);
ASSERT (result != 0);
- ASSERT (result == errno);
ASSERT (errno == EINVAL);
}
@@ -109,7 +107,6 @@
errno = 0;
result = ptsname_r (-1, buffer, sizeof buffer);
ASSERT (result != 0);
- ASSERT (result == errno);
ASSERT (errno == EBADF || errno == ENOTTY);
}
--
In memoriam Cornstalk <http://en.wikipedia.org/wiki/Cornstalk>