summaryrefslogtreecommitdiff
path: root/setupapi/setupapi_windows_test.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-02-04 11:49:26 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-05 12:59:42 +0100
commit024a4916c245ca6b15b65995fae2002f50b11186 (patch)
tree5cc66c5b3cb8acde29bc289895c5a59e5eb78eac /setupapi/setupapi_windows_test.go
parent963be8e993ae5688f3b0c490813a95391ec98c53 (diff)
downloadwireguard-go-024a4916c245ca6b15b65995fae2002f50b11186.tar.gz
wireguard-go-024a4916c245ca6b15b65995fae2002f50b11186.zip
Add support for setupapi.setupDiCreateDeviceInfoListEx()
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'setupapi/setupapi_windows_test.go')
-rw-r--r--setupapi/setupapi_windows_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/setupapi/setupapi_windows_test.go b/setupapi/setupapi_windows_test.go
index 17d6d8e..c99da6f 100644
--- a/setupapi/setupapi_windows_test.go
+++ b/setupapi/setupapi_windows_test.go
@@ -70,6 +70,29 @@ func TestSetupDiClassGuidsFromNameEx(t *testing.T) {
}
}
+func TestSetupDiCreateDeviceInfoListEx(t *testing.T) {
+ devInfoList, err := SetupDiCreateDeviceInfoListEx(&deviceClassNetGUID, 0, "")
+ if err == nil {
+ devInfoList.Close()
+ } else {
+ t.Errorf("Error calling SetupDiCreateDeviceInfoListEx: %s", err.Error())
+ }
+
+ devInfoList, err = SetupDiCreateDeviceInfoListEx(&deviceClassNetGUID, 0, computerName)
+ if err == nil {
+ devInfoList.Close()
+ } else {
+ t.Errorf("Error calling SetupDiCreateDeviceInfoListEx: %s", err.Error())
+ }
+
+ devInfoList, err = SetupDiCreateDeviceInfoListEx(nil, 0, "")
+ if err == nil {
+ devInfoList.Close()
+ } else {
+ t.Errorf("Error calling SetupDiCreateDeviceInfoListEx(nil): %s", err.Error())
+ }
+}
+
func TestSetupDiGetClassDevsEx(t *testing.T) {
devInfoList, err := SetupDiGetClassDevsEx(&deviceClassNetGUID, "PCI", 0, DIGCF_PRESENT, DevInfo(0), computerName)
if err == nil {