diff options
author | Simon Rozman <simon@rozman.si> | 2019-02-01 10:58:06 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-05 12:59:42 +0100 |
commit | d41bc015ccc06feedd21c0a87b0a44a02b74d530 (patch) | |
tree | eac0a0c74e2077ba1e605b6dcedc9acbda9f2510 /setupapi/zsetupapi_windows_test.go | |
parent | 31949136df477c5699d7476e909d9bf30a0904cc (diff) | |
download | wireguard-go-d41bc015ccc06feedd21c0a87b0a44a02b74d530.tar.gz wireguard-go-d41bc015ccc06feedd21c0a87b0a44a02b74d530.zip |
Finish support for setupapi.SetupDiGetClassDevsEx()
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to '')
-rw-r--r-- | setupapi/zsetupapi_windows_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/setupapi/zsetupapi_windows_test.go b/setupapi/zsetupapi_windows_test.go new file mode 100644 index 0000000..09b9195 --- /dev/null +++ b/setupapi/zsetupapi_windows_test.go @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: MIT + * + * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. + */ + +package setupapi + +import ( + "syscall" + "testing" + + "golang.org/x/sys/windows" +) + +func TestSetupDiDestroyDeviceInfoList(t *testing.T) { + err := SetupDiDestroyDeviceInfoList(DevInfo(windows.InvalidHandle)) + if errWin, ok := err.(syscall.Errno); !ok || errWin != 6 /*ERROR_INVALID_HANDLE*/ { + t.Errorf("SetupDiDestroyDeviceInfoList(nil, ...) should fail with ERROR_INVALID_HANDLE") + } +} |