Replace descriptor Configs with a map - config ids are arbitrary numbers

(unlike interface or alt setting numbers, which are 0-based array indices).
This makes it easier to access a particular config without having to
iterate over the descriptors.
This commit is contained in:
Sebastian Zagrodzki
2017-04-29 11:56:49 +02:00
parent 60d0aba507
commit 77c176cd4c
4 changed files with 22 additions and 26 deletions

View File

@@ -47,7 +47,7 @@ func TestOpenEndpoint(t *testing.T) {
if err != nil {
t.Fatalf("%s.InEndpoint(6): got error %v, want nil", intf, err)
}
if want := fakeDevices[1].Configs[0].Interfaces[1].AltSettings[1].Endpoints[1]; !reflect.DeepEqual(got.Info, want) {
if want := fakeDevices[1].Configs[1].Interfaces[1].AltSettings[1].Endpoints[1]; !reflect.DeepEqual(got.Info, want) {
t.Errorf("%s.InEndpoint(6): got %+v, want %+v", intf, got, want)
}