Mercurial > hg > octave-lojdl > gnulib-hg
comparison tests/test-renameat.c @ 14632:4843b6870f07
tests: reduce dependencies
We can assume that tests won't be run from a directory with an
absolute name longer than native getcwd limits.
* tests/test-linkat.c (main): Use lighter-weight getcwd.
* tests/test-renameat.c (main): Likewise.
* modules/linkat-tests (Depends-on): Relax dependency.
* modules/renameat-tests (Depends-on): Likewise.
* modules/fchdir-tests (Depends-on): Likewise. Also make cloexec
dependency explicit.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Tue, 26 Apr 2011 15:23:23 -0600 |
parents | 97fc9a21a8fb |
children | 4cb21966f305 |
comparison
equal
deleted
inserted
replaced
14631:477dcbd7cb5d | 14632:4843b6870f07 |
---|---|
31 #include <string.h> | 31 #include <string.h> |
32 #include <unistd.h> | 32 #include <unistd.h> |
33 #include <sys/stat.h> | 33 #include <sys/stat.h> |
34 | 34 |
35 #include "filenamecat.h" | 35 #include "filenamecat.h" |
36 #include "xgetcwd.h" | |
37 #include "ignore-value.h" | 36 #include "ignore-value.h" |
38 #include "macros.h" | 37 #include "macros.h" |
39 | 38 |
40 #define BASE "test-renameat.t" | 39 #define BASE "test-renameat.t" |
41 | 40 |
77 ASSERT (mkdir (BASE "sub1", 0700) == 0); | 76 ASSERT (mkdir (BASE "sub1", 0700) == 0); |
78 ASSERT (mkdir (BASE "sub2", 0700) == 0); | 77 ASSERT (mkdir (BASE "sub2", 0700) == 0); |
79 dfd = creat (BASE "00", 0600); | 78 dfd = creat (BASE "00", 0600); |
80 ASSERT (0 <= dfd); | 79 ASSERT (0 <= dfd); |
81 ASSERT (close (dfd) == 0); | 80 ASSERT (close (dfd) == 0); |
82 cwd = xgetcwd (); | 81 cwd = getcwd (NULL, 0); |
82 ASSERT (cwd); | |
83 | 83 |
84 dfd = open (BASE "sub1", O_RDONLY); | 84 dfd = open (BASE "sub1", O_RDONLY); |
85 ASSERT (0 <= dfd); | 85 ASSERT (0 <= dfd); |
86 ASSERT (chdir (BASE "sub2") == 0); | 86 ASSERT (chdir (BASE "sub2") == 0); |
87 | 87 |