mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 03:25:52 +08:00
25 lines
335 B
Go
25 lines
335 B
Go
package gortsplib
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAsyncProcessorCloseAfterError(t *testing.T) {
|
|
p := &asyncProcessor{bufferSize: 8}
|
|
p.initialize()
|
|
|
|
p.push(func() error {
|
|
return fmt.Errorf("ok")
|
|
})
|
|
|
|
p.start()
|
|
|
|
<-p.chStopped
|
|
require.EqualError(t, p.stopError, "ok")
|
|
|
|
p.close()
|
|
}
|