test-linkat: make test more robust
authorEric Blake <ebb9@byu.net>
Thu, 24 Sep 2009 22:49:49 +0000 (16:49 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 25 Sep 2009 01:28:32 +0000 (19:28 -0600)
* tests/test-linkat.c (main): Avoid collision with EEXIST.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
tests/test-linkat.c

index 35f84c4..7697802 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-09-24  Eric Blake  <ebb9@byu.net>
 
+       test-linkat: make test more robust
+       * tests/test-linkat.c (main): Avoid collision with EEXIST.
+
        getopt: fix inclusion guards for cygwin
        * modules/getopt-posix (Depends-on): Add include-next.
        (Makefile.am): Substitute more items in replacement header.
index afb1799..f5c4c77 100644 (file)
@@ -302,6 +302,7 @@ main ()
   errno = 0;
   ASSERT (areadlink (BASE "file") == NULL);
   ASSERT (errno == EINVAL);
+  ASSERT (unlink (BASE "file") == 0);
   ASSERT (unlink (BASE "link5") == 0);
   ASSERT (symlink (BASE "link3", BASE "link5") == 0);
   errno = 0;
@@ -346,7 +347,6 @@ main ()
   ASSERT (unlink (BASE "link3") == 0);
   ASSERT (unlink (BASE "link4") == 0);
   ASSERT (unlink (BASE "link5") == 0);
-  ASSERT (unlink (BASE "file") == 0);
   free (cwd);
   return result;
 }