X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-unlink.h;h=13f6c9bd4f92f510beb61fb361ce77b4d0932405;hb=1a6fbdd7d28dff1868c5eb0baf0029b27e42526a;hp=80cce948662b0c06d742f5516f7e9d1e0bd78166;hpb=ff4e8f6b53d7b8c53856ba8ba2adaad3251e6a88;p=gnulib.git diff --git a/tests/test-unlink.h b/tests/test-unlink.h index 80cce9486..13f6c9bd4 100644 --- a/tests/test-unlink.h +++ b/tests/test-unlink.h @@ -1,5 +1,5 @@ /* Tests of unlink. - Copyright (C) 2009 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 @@ -25,9 +25,6 @@ static int test_unlink_func (int (*func) (char const *name), bool print) { - /* Remove any leftovers from a previous partial run. */ - ASSERT (system ("rm -rf " BASE "*") == 0); - /* Setup. */ ASSERT (mkdir (BASE "dir", 0700) == 0); ASSERT (close (creat (BASE "dir/file", 0600)) == 0); @@ -68,14 +65,17 @@ test_unlink_func (int (*func) (char const *name), bool print) ASSERT (func (BASE "dir/file") == 0); ASSERT (rmdir (BASE "dir") == 0); if (print) - fputs ("skipping test: symlinks not supported on this filesystem\n", - stderr); + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); return 77; } if (cannot_unlink_dir ()) ASSERT (func (BASE "link/") == -1); ASSERT (func (BASE "link") == 0); ASSERT (symlink (BASE "dir/file", BASE "link") == 0); + errno = 0; + ASSERT (func (BASE "link/") == -1); + ASSERT (errno == ENOTDIR); /* Order here proves unlink of a symlink does not follow through to the file. */ ASSERT (func (BASE "link") == 0);