Skip to content

Fixes test case TestNSFileManger.test_fileAttributes #58

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

Merged
merged 1 commit into from
Dec 7, 2015
Merged

Fixes test case TestNSFileManger.test_fileAttributes #58

merged 1 commit into from
Dec 7, 2015

Conversation

bolshedvorsky
Copy link
Contributor

Check only for the existence of file owner's account (user) identifier instead of comparing its numeric value because

  • user identifier of 0 are assigned to the superuser in linux
  • negative value are valid account identifier. e.g. nobody is -2 (See https://en.wikipedia.org/wiki/User_identifier)
  • There's an assumption made here that account identifier are numeric which is reasonable for most system but there's a slim chance that this might not be the case.

Thanks to @lxcid

Check only for the existence of file owner's account (user) identifier instead of comparing its numeric value because
- user identifier of `0` are assigned to the superuser in linux
- negative value are valid account identifier. e.g. `nobody` is `-2` (See https://en.wikipedia.org/wiki/User_identifier)
- There's an assumption made here that account identifier are numeric which is reasonable for most system but there's a slim chance that this might not be the case.

Thanks to @lxcid
@lxcid
Copy link

lxcid commented Dec 7, 2015

Thanks! :D

@phausler
Copy link
Contributor

phausler commented Dec 7, 2015

The assumption would probably just mean that we would not run this test on platforms like windows if/when it is ported to there.
Otherwise looks pretty reasonable to me.

phausler added a commit that referenced this pull request Dec 7, 2015
Fixes test case TestNSFileManger.test_fileAttributes
@phausler phausler merged commit 65cdfac into swiftlang:master Dec 7, 2015
@bolshedvorsky
Copy link
Contributor Author

Current implementation of the API returns NSNumber value for the NSFileOwnerAccountID key. This unit test checks if we are getting an NSNumber value for this key.

@13rac1
Copy link

13rac1 commented Dec 7, 2015

Thanks for fixing quick @bartekchlebek !

kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants