device/alsa: check error

This commit is contained in:
Dan Kortschak 2021-07-23 12:56:27 +09:30 committed by Russell Stanley
parent baef3c0585
commit 5f4bcb61e0
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ func TestDevice(t *testing.T) {
}
cs := ai.DataSize()
lexer, err := codecutil.NewByteLexer(cs)
if err != nil {
t.Fatalf("unexpected error creating byte lexer: %v", err)
}
go lexer.Lex(ioutil.Discard, ai, time.Duration(c.RecPeriod*float64(time.Second)))
time.Sleep(time.Duration(c.RecPeriod*float64(time.Second)) * time.Duration(n))
ai.Stop()