summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/filesystem
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-02-05 17:21:52 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-02-05 17:21:52 +0000
commit2f7ceb120eb0ece24c671b27680025ffe75eae9d (patch)
treed7372a12260e7cd1feb27705b647b7b6855c23de /libcxx/test/std/experimental/filesystem
parent49c21222a0d6086ea1d3021bfbc0b119e0c07454 (diff)
downloadbcm5719-llvm-2f7ceb120eb0ece24c671b27680025ffe75eae9d.tar.gz
bcm5719-llvm-2f7ceb120eb0ece24c671b27680025ffe75eae9d.zip
filesystem: fix n4100 conformance for `temp_directory_path`
N4100 states that an error shall be reported if `!exists(p) || !is_directory(p)`. We were missing the first half of the conditional. Invert the error and normal code paths to make the code easier to follow. llvm-svn: 294127
Diffstat (limited to 'libcxx/test/std/experimental/filesystem')
-rw-r--r--libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
index 148564e6196..021dd7fc816 100644
--- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
+++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
@@ -97,6 +97,14 @@ TEST_CASE(basic_tests)
TEST_CHECK(ec == std::make_error_code(std::errc::permission_denied));
TEST_CHECK(ret == "");
+ // Set the env variable to point to a non-existent dir
+ PutEnv(TC.name, TC.p / "does_not_exist");
+ ec = GetTestEC();
+ ret = temp_directory_path(ec);
+ TEST_CHECK(ec != GetTestEC());
+ TEST_CHECK(ec);
+ TEST_CHECK(ret == "");
+
// Finally erase this env variable
UnsetEnv(TC.name);
}
OpenPOWER on IntegriCloud