X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-futimens.h;h=9c9b1bb283541c7b91d413e085af274ddc6e0267;hb=b12df021ba5b5f12648d84f91d021777c347e9be;hp=a0312b7f883ee1956daf36aaaffa990288ea3756;hpb=0afab138f4aedb7eaab70957c164aa0e5eb01fce;p=gnulib.git diff --git a/tests/test-futimens.h b/tests/test-futimens.h index a0312b7f8..9c9b1bb28 100644 --- a/tests/test-futimens.h +++ b/tests/test-futimens.h @@ -1,5 +1,5 @@ /* Test of file timestamp modification functions. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -74,9 +74,29 @@ test_futimens (int (*func) (int, struct timespec const *), } /* Invalid arguments. */ - errno = 0; - ASSERT (func (-1, NULL) == -1); - ASSERT (errno == EBADF); + { + errno = 0; + ASSERT (func (AT_FDCWD, NULL) == -1); + ASSERT (errno == EBADF); + } + { + errno = 0; + ASSERT (func (-1, NULL) == -1); + ASSERT (errno == EBADF); + } + { + errno = 0; + ASSERT (func (99, NULL) == -1); + ASSERT (errno == EBADF); + } + { + int fd0 = dup (0); + ASSERT (0 <= fd0); + ASSERT (close (fd0) == 0); + errno = 0; + ASSERT (func (fd0, NULL) == -1); + ASSERT (errno == EBADF); + } { struct timespec ts[2] = { { Y2K, UTIME_BOGUS_POS }, { Y2K, 0 } }; errno = 0;