summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2017-02-08 09:57:32 +0000
committerMichal Gorny <mgorny@gentoo.org>2017-02-08 09:57:32 +0000
commitf7132c83f161e379f1265bf985ce2795164601df (patch)
tree0020847ffaefedf2a97d159c83f4cbd0ef2eedcf
parent5fba45ad1107903e37a80e47bfb21477b7ee5062 (diff)
downloadbcm5719-llvm-f7132c83f161e379f1265bf985ce2795164601df.tar.gz
bcm5719-llvm-f7132c83f161e379f1265bf985ce2795164601df.zip
[test] Fix hard_link_count test to account for fs with dir nlink==1
Filesystems are not required to maintain a hard link count consistent with number of subdirectories. For example, on btrfs all directories have nlink==1. Account for that in the test. Differential Revision: https://reviews.llvm.org/D29706 llvm-svn: 294431
-rw-r--r--libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
index 7537ac20c75..6b542a5b67a 100644
--- a/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
+++ b/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
@@ -57,15 +57,19 @@ TEST_CASE(hard_link_count_for_directory)
Dir3Expect = 3; // . .. file5
#endif
TEST_CHECK(hard_link_count(StaticEnv::Dir) == DirExpect ||
- hard_link_count(StaticEnv::Dir) == DirExpectAlt);
+ hard_link_count(StaticEnv::Dir) == DirExpectAlt ||
+ hard_link_count(StaticEnv::Dir) == 1);
TEST_CHECK(hard_link_count(StaticEnv::Dir3) == Dir3Expect ||
- hard_link_count(StaticEnv::Dir3) == Dir3ExpectAlt);
+ hard_link_count(StaticEnv::Dir3) == Dir3ExpectAlt ||
+ hard_link_count(StaticEnv::Dir3) == 1);
std::error_code ec;
TEST_CHECK(hard_link_count(StaticEnv::Dir, ec) == DirExpect ||
- hard_link_count(StaticEnv::Dir, ec) == DirExpectAlt);
+ hard_link_count(StaticEnv::Dir, ec) == DirExpectAlt ||
+ hard_link_count(StaticEnv::Dir) == 1);
TEST_CHECK(hard_link_count(StaticEnv::Dir3, ec) == Dir3Expect ||
- hard_link_count(StaticEnv::Dir3, ec) == Dir3ExpectAlt);
+ hard_link_count(StaticEnv::Dir3, ec) == Dir3ExpectAlt ||
+ hard_link_count(StaticEnv::Dir3) == 1);
}
TEST_CASE(hard_link_count_increments_test)
{
OpenPOWER on IntegriCloud