diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-10-16 00:47:59 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-10-16 00:47:59 +0000 |
commit | ecafa8739e1b2ed2898ff1db3653657adacb99f1 (patch) | |
tree | 8c4477d678c144372971319b1a148c2a5a728771 /libcxx/test/std/experimental/filesystem | |
parent | 4fba10c3940919ba7a845bd785e6e05262d671a1 (diff) | |
download | bcm5719-llvm-ecafa8739e1b2ed2898ff1db3653657adacb99f1.tar.gz bcm5719-llvm-ecafa8739e1b2ed2898ff1db3653657adacb99f1.zip |
Implement LWG 2712 and update other issues status
llvm-svn: 284318
Diffstat (limited to 'libcxx/test/std/experimental/filesystem')
-rw-r--r-- | libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp index ac9877bbd9c..1b56c709797 100644 --- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp +++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp @@ -153,12 +153,36 @@ TEST_CASE(copy_dir_test) scoped_test_env env; const path file = env.create_file("file1", 42); const path dest = env.create_dir("dir1"); - std::error_code ec; + std::error_code ec = GetTestEC(); TEST_CHECK(fs::copy_file(file, dest, ec) == false); TEST_CHECK(ec); - ec.clear(); + TEST_CHECK(ec != GetTestEC()); + ec = GetTestEC(); TEST_CHECK(fs::copy_file(dest, file, ec) == false); TEST_CHECK(ec); + TEST_CHECK(ec != GetTestEC()); +} + +TEST_CASE(non_regular_file_test) +{ + scoped_test_env env; + const path fifo = env.create_fifo("fifo"); + const path dest = env.make_env_path("dest"); + const path file = env.create_file("file", 42); + { + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(fifo, dest, ec) == false); + TEST_CHECK(ec); + TEST_CHECK(ec != GetTestEC()); + TEST_CHECK(!exists(dest)); + } + { + std::error_code ec = GetTestEC(); + TEST_REQUIRE(fs::copy_file(file, fifo, copy_options::overwrite_existing, ec) == false); + TEST_CHECK(ec); + TEST_CHECK(ec != GetTestEC()); + TEST_CHECK(is_fifo(fifo)); + } } TEST_SUITE_END() |