aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/kylelemons/gousb/usb/config_test.go
blob: f4cbbcf3b72d2fb74f0b21c9e73687185e338e1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package usb

import "testing"

func TestEndpointInfo(t *testing.T) {
	for _, tc := range []struct {
		ep   EndpointInfo
		want string
	}{
		{
			ep: EndpointInfo{
				Address:       0x86,
				Attributes:    0x02,
				MaxPacketSize: 512,
			},
			want: "Endpoint #6 IN  bulk - unsynchronized data [512 0]",
		},
		{
			ep: EndpointInfo{
				Address:       0x02,
				Attributes:    0x05,
				MaxPacketSize: 512,
				MaxIsoPacket:  512,
			},
			want: "Endpoint #2 OUT isochronous - asynchronous data [512 512]",
		},
	} {
		if got := tc.ep.String(); got != tc.want {
			t.Errorf("%#v.String(): got %q, want %q", tc.ep, got, tc.want)
		}
	}
}