Skip to content

Correct GetVolumeInformation return type handling#188

Merged
katiewasnothere merged 1 commit intomicrosoft:masterfrom
TBBle:correct-GetVolumeInformation-return-handling
Feb 10, 2021
Merged

Correct GetVolumeInformation return type handling#188
katiewasnothere merged 1 commit intomicrosoft:masterfrom
TBBle:correct-GetVolumeInformation-return-handling

Conversation

@TBBle
Copy link
Contributor

@TBBle TBBle commented Jan 16, 2021

The docs say it returns 0 for failure, non-zero for success.

This implementation is looking for <0 as HRESULT failure, and deriving
an Errno from that.

The new tests fail with GetFileSystemType as it was defined, e.g.,

--- FAIL: TestGetFSTypeOfValidButAbsentDrive (0.00s)
    fs_windows_test.go:41: GetFileSystemType a:\ unexpectedly succeeded

when I definitely do not have an A:\ drive.

The _docs_ say it returns 0 for failure, non-zero for success.

This implementation is looking for <0 as HRESULT failure, and deriving
an Errno from that.

The new tests fail with GetFileSystemType as it was defined, e.g.,
```
--- FAIL: TestGetFSTypeOfValidButAbsentDrive (0.00s)
    fs_windows_test.go:41: GetFileSystemType a:\ unexpectedly succeeded
```
when I definitely do not have an A:\ drive.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Copy link

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@katiewasnothere katiewasnothere merged commit a38e1dc into microsoft:master Feb 10, 2021
@TBBle TBBle deleted the correct-GetVolumeInformation-return-handling branch February 10, 2021 05:20
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.

2 participants