From d92ea14c33b0f19e16f86c4c0164f3193132dec5 Mon Sep 17 00:00:00 2001 From: Sebastian Zagrodzki Date: Mon, 10 Apr 2017 03:25:32 +0200 Subject: [PATCH] Add a test to catch invalud endpoint info. --- usb/device_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usb/device_test.go b/usb/device_test.go index 9224d0c..6ddae40 100644 --- a/usb/device_test.go +++ b/usb/device_test.go @@ -33,11 +33,11 @@ func TestOpenEndpoint(t *testing.T) { if err != nil { t.Fatalf("OpenDeviceWithVidPid(0x8888, 0x0002): got error %v, want nil", err) } - got, err := dev.InEndpoint(1, 1, 2, 6) + got, err := dev.InEndpoint(1, 1, 1, 6) if err != nil { - t.Fatalf("InEndpoint(cfg=1, if=1, alt=2, ep=6IN): got error %v, want nil", err) + t.Fatalf("InEndpoint(cfg=1, if=1, alt=1, ep=6IN): got error %v, want nil", err) } - if want := fakeDevices[1].Configs[0].Interfaces[1].AltSettings[2].Endpoints[1]; !reflect.DeepEqual(got.Info, want) { - t.Errorf("InEndpoint(cfg=1, if=1, alt=2, ep=6IN): got %+v, want %+v", got, want) + if want := fakeDevices[1].Configs[0].Interfaces[1].AltSettings[1].Endpoints[1]; !reflect.DeepEqual(got.Info, want) { + t.Errorf("InEndpoint(cfg=1, if=1, alt=1, ep=6IN): got %+v, want %+v", got, want) } }