diff options
Diffstat (limited to 'tun/wintun/setupapi/setupapi_windows_test.go')
-rw-r--r-- | tun/wintun/setupapi/setupapi_windows_test.go | 20 |
1 files changed, 15 insertions, 5 deletions
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) { |