test: ffmpeg processor tests
This commit is contained in:
parent
bb48a1e717
commit
d9c697a0b2
13 changed files with 165 additions and 15 deletions
15
ffmpeg/errors_test.go
Normal file
15
ffmpeg/errors_test.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package ffmpeg
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
assert.Equal(t, "ffmpeg: cannot allocate memory", ErrNoMem.Error())
|
||||
assert.Equal(t, "ffmpeg: end of file", ErrEOF.Error())
|
||||
assert.Equal(t, "ffmpeg: unknown error occurred", ErrUnknown.Error())
|
||||
assert.Equal(t, "ffmpeg: decoder not found", ErrDecoderNotFound.Error())
|
||||
assert.Equal(t, "ffmpeg: invalid data found when processing input", ErrInvalidData.Error())
|
||||
assert.Equal(t, "ffmpeg: video or cover art size exceeds maximum allowed dimensions", ErrTooBig.Error())
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ var files = []string{
|
|||
|
||||
var baseDir = "../testdata/"
|
||||
|
||||
func TestAVContextMeta(t *testing.T) {
|
||||
func TestAVContext(t *testing.T) {
|
||||
vips.Startup(nil)
|
||||
SetFFmpegLogLevel(AVLogDebug)
|
||||
logger := zap.NewExample()
|
||||
|
|
@ -43,7 +43,7 @@ func TestAVContextMeta(t *testing.T) {
|
|||
}
|
||||
})
|
||||
require.NoError(t, os.MkdirAll(baseDir+"golden/meta", 0755))
|
||||
require.NoError(t, os.MkdirAll(baseDir+"golden/result", 0755))
|
||||
require.NoError(t, os.MkdirAll(baseDir+"golden/export", 0755))
|
||||
t.Parallel()
|
||||
for _, filename := range files {
|
||||
t.Run(filename, func(t *testing.T) {
|
||||
|
|
@ -87,12 +87,3 @@ func TestAVContextMeta(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
assert.Equal(t, "ffmpeg: cannot allocate memory", ErrNoMem.Error())
|
||||
assert.Equal(t, "ffmpeg: end of file", ErrEOF.Error())
|
||||
assert.Equal(t, "ffmpeg: unknown error occurred", ErrUnknown.Error())
|
||||
assert.Equal(t, "ffmpeg: decoder not found", ErrDecoderNotFound.Error())
|
||||
assert.Equal(t, "ffmpeg: invalid data found when processing input", ErrInvalidData.Error())
|
||||
assert.Equal(t, "ffmpeg: video or cover art size exceeds maximum allowed dimensions", ErrTooBig.Error())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue