From 024a4916c245ca6b15b65995fae2002f50b11186 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 Feb 2019 11:49:26 +0100 Subject: Add support for setupapi.setupDiCreateDeviceInfoListEx() Signed-off-by: Simon Rozman --- setupapi/setupapi_windows_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'setupapi/setupapi_windows_test.go') 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 { -- cgit v1.2.3