|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79467 - trunk/libs/filesystem/test/issues
From: bdawes_at_[hidden]
Date: 2012-07-13 08:28:08
Author: bemandawes
Date: 2012-07-13 08:28:08 EDT (Fri, 13 Jul 2012)
New Revision: 79467
URL: http://svn.boost.org/trac/boost/changeset/79467
Log:
Add a directory for issues related test programs.
Added:
trunk/libs/filesystem/test/issues/
trunk/libs/filesystem/test/issues/fchmodat_AT_SYMLINK_NOFOLLOW_6659.cpp (contents, props changed)
trunk/libs/filesystem/test/issues/readme.txt (contents, props changed)
Added: trunk/libs/filesystem/test/issues/fchmodat_AT_SYMLINK_NOFOLLOW_6659.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/filesystem/test/issues/fchmodat_AT_SYMLINK_NOFOLLOW_6659.cpp 2012-07-13 08:28:08 EDT (Fri, 13 Jul 2012)
@@ -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;
+}
Added: trunk/libs/filesystem/test/issues/readme.txt
==============================================================================
--- (empty file)
+++ trunk/libs/filesystem/test/issues/readme.txt 2012-07-13 08:28:08 EDT (Fri, 13 Jul 2012)
@@ -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
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk