mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-06 09:07:03 +08:00
setupapi: Merge SP_DRVINFO_DATA and DrvInfoData
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user