mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
libredirect: add tests for new wrappers
This commit is contained in:
parent
eb620ff9f7
commit
2cfe8451ed
|
@ -63,6 +63,12 @@ int main(int argc, char *argv[])
|
|||
FILE *testfp;
|
||||
int testfd;
|
||||
struct stat testsb;
|
||||
#ifndef __APPLE__
|
||||
struct stat64 testsb64;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
struct statx testsbx;
|
||||
#endif
|
||||
char buf[PATH_MAX];
|
||||
|
||||
testfp = fopen(TESTPATH, "r");
|
||||
|
@ -76,6 +82,20 @@ int main(int argc, char *argv[])
|
|||
assert(access(TESTPATH, X_OK) == 0);
|
||||
|
||||
assert(stat(TESTPATH, &testsb) != -1);
|
||||
#ifndef __APPLE__
|
||||
assert(stat64(TESTPATH, &testsb64) != -1);
|
||||
#endif
|
||||
assert(fstatat(123, TESTPATH, &testsb, 0) != -1);
|
||||
#ifndef __APPLE__
|
||||
assert(fstatat64(123, TESTPATH, &testsb64, 0) != -1);
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
assert(statx(123, TESTPATH, 0, STATX_ALL, &testsbx) != -1);
|
||||
#endif
|
||||
|
||||
assert(getcwd(buf, PATH_MAX) != NULL);
|
||||
assert(chdir(TESTDIR) == 0);
|
||||
assert(chdir(buf) == 0);
|
||||
|
||||
assert(mkdir(TESTDIR "/dir-mkdir", 0777) == 0);
|
||||
assert(unlink(TESTDIR "/dir-mkdir") == -1); // it's a directory!
|
||||
|
|
Loading…
Reference in a new issue