mgorny created this revision.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D29706

Files:
  
test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp


Index: 
test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
===================================================================
--- 
test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
+++ 
test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
@@ -57,15 +57,19 @@
     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)
 {


Index: test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
===================================================================
--- test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
+++ test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
@@ -57,15 +57,19 @@
     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)
 {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D29706: [libcxx] [t... Michał Górny via Phabricator via cfe-commits

Reply via email to