[PATCH] D29706: [libcxx] [test] Fix hard_link_count test to account for fs with dir nlink==1
This revision was automatically updated to reflect the committed changes. Closed by commit rL294431: [test] Fix hard_link_count test to account for fs with dir nlink==1 (authored by mgorny). Changed prior to commit: https://reviews.llvm.org/D29706?vs=87613=87618#toc Repository: rL LLVM https://reviews.llvm.org/D29706 Files: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp Index: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp === --- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp +++ libcxx/trunk/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: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp === --- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp +++ libcxx/trunk/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] [test] Fix hard_link_count test to account for fs with dir nlink==1
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