device/alsa: check error

This commit is contained in:
Dan Kortschak 2021-07-23 12:56:27 +09:30
parent 95991f4c75
commit 2d37aa73dc
No known key found for this signature in database
GPG Key ID: 45817BAD958E3F0C
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ func TestDevice(t *testing.T) {
} }
cs := ai.DataSize() cs := ai.DataSize()
lexer, err := codecutil.NewByteLexer(cs) 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))) 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)) time.Sleep(time.Duration(c.RecPeriod*float64(time.Second)) * time.Duration(n))
ai.Stop() ai.Stop()