From b662896cf42acaf09bdee948de3bd6b9abea257c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 7 Feb 2019 23:12:58 +0100 Subject: setupapi: Merge SP_DRVINFO_DATA and DrvInfoData Signed-off-by: Simon Rozman --- tun/wintun/setupapi/setupapi_windows_test.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'tun/wintun/setupapi/setupapi_windows_test.go') diff --git a/tun/wintun/setupapi/setupapi_windows_test.go b/tun/wintun/setupapi/setupapi_windows_test.go index 32e0f1e..a6dedbe 100644 --- a/tun/wintun/setupapi/setupapi_windows_test.go +++ b/tun/wintun/setupapi/setupapi_windows_test.go @@ -166,7 +166,7 @@ func TestDevInfo_BuildDriverInfoList(t *testing.T) { } defer devInfoList.DestroyDriverInfoList(deviceData, driverType) - var selectedDriverData *SP_DRVINFO_DATA + var selectedDriverData *DrvInfoData for j := 0; true; j++ { driverData, err := devInfoList.EnumDriverInfo(deviceData, driverType, j) if err != nil { @@ -176,10 +176,6 @@ func TestDevInfo_BuildDriverInfoList(t *testing.T) { continue } - if driverData2, err2 := driverData.toGo().toWindows(); err2 != nil || *driverData2 != *driverData { - t.Error("Error converting between SP_DRVINFO_DATA and DrvInfoData") - } - if driverData.DriverType == 0 { continue } @@ -238,6 +234,20 @@ func TestDevInfo_BuildDriverInfoList(t *testing.T) { t.Error("SetupDiGetSelectedDriver should return driver selected with SetupDiSetSelectedDriver") } } + + data := &DrvInfoData{} + data.SetDescription("foobar") + if data.GetDescription() != "foobar" { + t.Error("DrvInfoData.(Get|Set)Description() differ") + } + data.SetMfgName("foobar") + if data.GetMfgName() != "foobar" { + t.Error("DrvInfoData.(Get|Set)MfgName() differ") + } + data.SetProviderName("foobar") + if data.GetProviderName() != "foobar" { + t.Error("DrvInfoData.(Get|Set)ProviderName() differ") + } } func TestSetupDiGetClassDevsEx(t *testing.T) { -- cgit v1.2.3