Add a directory for issues related test programs.

[SVN r79467]
This commit is contained in:
Beman Dawes 2012-07-13 12:28:08 +00:00
parent bb0fe7585c
commit d5328e4d05
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,34 @@
// Test program to demonstrate that Linux does not support AT_SYMLINK_NOFOLLOW
// Copyright Duncan Exon Smith 2012
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// Test this by running:
//
// rm -rf data && mkdir data && g++ -otest-fchmodat test-fchmodat.cpp && (cd data && ../test-fchmodat)
//
// If no assertions go off, then it looks like fchmodat is supported,
// but AT_SYMLINK_NOFOLLOW is not supported.
#include <fstream>
#include <cassert>
#include <fcntl.h>
#include <sys/stat.h>
#include <cerrno>
int main(int argc, char *argv[])
{
{ std::ofstream file("out"); file << "contents"; }
assert(!::symlink("out", "sym"));
assert(!::fchmodat(AT_FDCWD, "out", S_IRUSR | S_IWUSR | S_IXUSR, 0));
assert(!::fchmodat(AT_FDCWD, "sym", S_IRUSR | S_IWUSR | S_IXUSR, 0));
assert(::fchmodat(AT_FDCWD, "sym", S_IRUSR | S_IWUSR | S_IXUSR, AT_SYMLINK_NOFOLLOW) == -1);
assert(errno == ENOTSUP);
return 0;
}

9
test/issues/readme.txt Normal file
View File

@ -0,0 +1,9 @@
This directory contains tests related to specific issues.
The names are intended to indicate both the function or condition being tested
and the issue number.
-----
Copyright Beman Dawes 2012
Distributed under the Boost Software License, Version 1.0.
See http://www.boost.org/LICENSE_1_0.txt