Re: [libcxx] r294431 - [test] Fix hard_link_count test to account for fs with dir nlink==1

2017-02-15 Thread Hans Wennborg via cfe-commits
Michal requested this to be merged in PR31965, it seems fine to me,
and Marshall OK'd it in an email to me. Merged in r295214.

On Wed, Feb 8, 2017 at 1:57 AM, Michal Gorny via cfe-commits
 wrote:
> Author: mgorny
> Date: Wed Feb  8 03:57:32 2017
> New Revision: 294431
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294431=rev
> Log:
> [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
>
> Modified:
> 
> libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
>
> Modified: 
> libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp?rev=294431=294430=294431=diff
> ==
> --- 
> libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
>  (original)
> +++ 
> libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
>  Wed Feb  8 03:57:32 2017
> @@ -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)
>  {
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r294431 - [test] Fix hard_link_count test to account for fs with dir nlink==1

2017-02-08 Thread Michal Gorny via cfe-commits
Author: mgorny
Date: Wed Feb  8 03:57:32 2017
New Revision: 294431

URL: http://llvm.org/viewvc/llvm-project?rev=294431=rev
Log:
[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

Modified:

libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp

Modified: 
libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp?rev=294431=294430=294431=diff
==
--- 
libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
 (original)
+++ 
libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.hard_lk_ct/hard_link_count.pass.cpp
 Wed Feb  8 03:57:32 2017
@@ -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)
 {


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits