X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-symlinkat.c;h=49eebee93a7a78015afc995aecb0de37f340df7b;hb=c9f0960c2cd1acf9c29b27860589698ea54fa4ec;hp=8cdc86d79d87c46043a27fe21fae527ea0bb6062;hpb=fd9f58dc85f6a45cd244c78a54ad4610c01dbb15;p=gnulib.git diff --git a/tests/test-symlinkat.c b/tests/test-symlinkat.c index 8cdc86d79..49eebee93 100644 --- a/tests/test-symlinkat.c +++ b/tests/test-symlinkat.c @@ -1,5 +1,5 @@ /* Tests of symlinkat. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2012 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 @@ -53,12 +53,27 @@ do_symlink (char const *contents, char const *name) int main (void) { - char buf[80]; int result; /* Remove any leftovers from a previous partial run. */ ignore_value (system ("rm -rf " BASE "*")); + /* Test behaviour for invalid file descriptors. */ + { + errno = 0; + ASSERT (symlinkat ("foo", -1, "bar") == -1); + ASSERT (errno == EBADF + || errno == ENOSYS /* seen on mingw */ + ); + } + { + errno = 0; + ASSERT (symlinkat ("foo", 99, "bar") == -1); + ASSERT (errno == EBADF + || errno == ENOSYS /* seen on mingw */ + ); + } + /* Perform same checks as counterpart functions. */ result = test_symlink (do_symlink, false); dfd = openat (AT_FDCWD, ".", O_RDONLY);