update tests with the new "transfer done" logic.

This commit is contained in:
Sebastian Zagrodzki
2017-04-26 21:40:51 +02:00
parent fbd26497e6
commit ae8627a890
2 changed files with 6 additions and 7 deletions

View File

@@ -93,18 +93,18 @@ func TestTransferProtocol(t *testing.T) {
ft.length = 5
ft.status = TransferCompleted
copy(ft.buf, []byte{1, 2, 3, 4, 5})
close(ft.done)
ft.done <- struct{}{}
ft = f.waitForSubmitted()
ft.length = 99
ft.status = TransferCompleted
copy(ft.buf, []byte{12, 12, 12, 12, 12})
close(ft.done)
ft.done <- struct{}{}
ft = f.waitForSubmitted()
ft.length = 123
ft.status = TransferCancelled
close(ft.done)
ft.done <- struct{}{}
}()
xfers[0].submit()