setupapi: Merge SP_DRVINFO_DATA and DrvInfoData

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman
2019-02-07 23:12:58 +01:00
parent 0525f6b112
commit b662896cf4
4 changed files with 79 additions and 79 deletions

View File

@@ -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) {