ensure the vid/pid match

This commit is contained in:
Sebastian Zagrodzki
2017-03-10 08:36:00 -05:00
parent ff7995c159
commit a221bef905

View File

@@ -78,6 +78,9 @@ func TestOpenDeviceWithVidPid(t *testing.T) {
t.Errorf("OpenDeviceWithVidPid(%s/%s): got error %v, want nil", ID(d.vid), ID(d.pid), err)
}
if dev != nil {
if dev.Descriptor.Vendor != ID(d.vid) || dev.Descriptor.Product != ID(d.pid) {
t.Errorf("OpenDeviceWithVidPid(%s/%s): the device returned has VID/PID %s/%s, different from specified in the arguments", ID(d.vid), ID(d.pid), dev.Descriptor.Vendor, dev.Descriptor.Product)
}
dev.Close()
}
}