diff options
author | Simon Rozman <simon@rozman.si> | 2019-02-07 23:12:58 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-02-07 23:50:43 +0100 |
commit | b662896cf42acaf09bdee948de3bd6b9abea257c (patch) | |
tree | 98b315136ee90d4ea887f7c25be90298f12cf9a9 /tun/wintun/setupapi/setupapi_windows_test.go | |
parent | 0525f6b112b21250f028c1373bbd4ecf3df1702b (diff) |
setupapi: Merge SP_DRVINFO_DATA and DrvInfoData
Signed-off-by: Simon Rozman <simon@rozman.si>
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) { |