Add "empty" to confirm no transfers are in flight in fakeusb.
Update endpoint_test - if buffer length is 0, no transfer is submitted.
This commit is contained in:
@@ -296,6 +296,11 @@ func (f *fakeLibusb) waitForSubmitted() *fakeTransfer {
|
||||
return <-f.submitted
|
||||
}
|
||||
|
||||
// empty can be used to confirm that all transfers were cleaned up.
|
||||
func (f *fakeLibusb) empty() bool {
|
||||
return len(f.submitted) == 0
|
||||
}
|
||||
|
||||
func newFakeLibusb() (*fakeLibusb, func() error) {
|
||||
origLibusb := libusb
|
||||
fl := &fakeLibusb{
|
||||
|
Reference in New Issue
Block a user