data, err := SetupDiGetDeviceInfoListDetail(devInfoList)
if err != nil {
t.Errorf("Error calling SetupDiGetDeviceInfoListDetail: %s", err.Error())
- }
-
- if data.ClassGUID != deviceClassNetGUID {
- t.Error("SetupDiGetDeviceInfoListDetail returned different class GUID")
- }
+ } else {
+ if data.ClassGUID != deviceClassNetGUID {
+ t.Error("SetupDiGetDeviceInfoListDetail returned different class GUID")
+ }
- if data.RemoteMachineHandle != windows.Handle(0) {
- t.Error("SetupDiGetDeviceInfoListDetail returned non-NULL remote machine handle")
- }
+ if data.RemoteMachineHandle != windows.Handle(0) {
+ t.Error("SetupDiGetDeviceInfoListDetail returned non-NULL remote machine handle")
+ }
- if data.RemoteMachineName != "" {
- t.Error("SetupDiGetDeviceInfoListDetail returned non-NULL remote machine name")
+ if data.RemoteMachineName != "" {
+ t.Error("SetupDiGetDeviceInfoListDetail returned non-NULL remote machine name")
+ }
}
}
data, err := SetupDiGetDeviceInfoListDetail(devInfoList)
if err != nil {
t.Errorf("Error calling SetupDiGetDeviceInfoListDetail: %s", err.Error())
- }
-
- if data.ClassGUID != deviceClassNetGUID {
- t.Error("SetupDiGetDeviceInfoListDetail returned different class GUID")
- }
+ } else {
+ if data.ClassGUID != deviceClassNetGUID {
+ t.Error("SetupDiGetDeviceInfoListDetail returned different class GUID")
+ }
- if data.RemoteMachineHandle == windows.Handle(0) {
- t.Error("SetupDiGetDeviceInfoListDetail returned NULL remote machine handle")
- }
+ if data.RemoteMachineHandle == windows.Handle(0) {
+ t.Error("SetupDiGetDeviceInfoListDetail returned NULL remote machine handle")
+ }
- if data.RemoteMachineName != computerName {
- t.Error("SetupDiGetDeviceInfoListDetail returned different remote machine name")
+ if data.RemoteMachineName != computerName {
+ t.Error("SetupDiGetDeviceInfoListDetail returned different remote machine name")
+ }
}
}