Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in test "30.10.15.15 hard_link_count" #97

Closed
phprus opened this issue Feb 11, 2021 · 3 comments
Closed

Error in test "30.10.15.15 hard_link_count" #97

phprus opened this issue Feb 11, 2021 · 3 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working test Issue with test code
Milestone

Comments

@phprus
Copy link
Contributor

phprus commented Feb 11, 2021

Describe the bug
hard_link_count test logic is wrong on BTRFS.
The links counter is always equal to 1 (https://unix.stackexchange.com/a/618726).

Error:

40: /home/.../3rdparty/ghc-filesystem/src/test/filesystem_test.cpp:2037: FAILED:
40:   CHECK( fs::hard_link_count(t.path()) == 2 )
40: with expansion:
40:   1 == 2
40:
40: /home/.../3rdparty/ghc-filesystem/src/test/filesystem_test.cpp:2039: FAILED:
40:   CHECK( fs::hard_link_count(t.path()) == 3 )
40: with expansion:
40:   1 == 3

To Reproduce
Run test on BTRFS.

@phprus
Copy link
Contributor Author

phprus commented Feb 12, 2021

Btrfs is are default file system on SUSE 12+ and Fedora 33+.

Possible workaround:
Replace CHECK(fs::hard_link_count(t.path()) == 2) to CHECK(fs::hard_link_count(t.path()) == 2 || fs::hard_link_count(t.path()) == 1);
and
CHECK(fs::hard_link_count(t.path()) == 3) to CHECK(fs::hard_link_count(t.path()) == 3 || fs::hard_link_count(t.path()) == 1);

@gulrak gulrak added bug Something isn't working test Issue with test code labels Feb 12, 2021
@gulrak gulrak self-assigned this Feb 12, 2021
@gulrak gulrak added this to the v1.5.2 milestone Feb 12, 2021
@gulrak
Copy link
Owner

gulrak commented Feb 12, 2021

Nice find. Ich think I prefer to use an lstat helper in filesystem_test for Linux to compare to its result, to keep the test from accepting 1 when the fs is not BTRFS. I'll look into it later today after work.

gulrak added a commit that referenced this issue Feb 13, 2021
… lstat result to support results from btrfs
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Feb 13, 2021
@gulrak
Copy link
Owner

gulrak commented Feb 27, 2021

This is now part of release v1.5.2

@gulrak gulrak closed this as completed Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working test Issue with test code
Projects
None yet
Development

No branches or pull requests

2 participants