Mercurial > hg > octave-kai > gnulib-hg
changeset 15663:2234b0721604
futimens: enhance test
Test that previous futimens change doesn't regress.
* tests/test-futimens.h (test_futimens): Also check for EBADF on
closed non-negative fd.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Mon, 19 Sep 2011 11:10:16 -0600 |
parents | 410c1c383d50 |
children | 5e2fa37219ff |
files | ChangeLog tests/test-futimens.h |
diffstat | 2 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-09-19 Eric Blake <eblake@redhat.com> + futimens: enhance test + * tests/test-futimens.h (test_futimens): Also check for EBADF on + closed non-negative fd. + date: accept 'hence' as opposite of 'ago' * lib/parse-datetime.y (relative_time_table): Add 'hence'. * tests/test-parse-datetime.c (main): Enhance test.
--- a/tests/test-futimens.h +++ b/tests/test-futimens.h @@ -81,6 +81,14 @@ ASSERT (func (-1, NULL) == -1); ASSERT (errno == EBADF); { + int fd = dup (0); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + errno = 0; + ASSERT (func (fd, NULL) == -1); + ASSERT (errno == EBADF); + } + { struct timespec ts[2] = { { Y2K, UTIME_BOGUS_POS }, { Y2K, 0 } }; errno = 0; ASSERT (func (fd, ts) == -1);