diff --git a/astiav_test.go b/astiav_test.go index c3b774e..c0f11d9 100644 --- a/astiav_test.go +++ b/astiav_test.go @@ -14,14 +14,17 @@ import ( var globalHelper = newHelper() func TestMain(m *testing.M) { - // Run - m.Run() + // Make sure to exit with the proper code + var code int + defer func(code *int) { + os.Exit(*code) + }(&code) // Make sure to close global helper - globalHelper.close() + defer globalHelper.close() - // Exit - os.Exit(0) + // Run + code = m.Run() } type helper struct { diff --git a/codec_test.go b/codec_test.go index 6dfa2ed..21db460 100644 --- a/codec_test.go +++ b/codec_test.go @@ -40,15 +40,14 @@ func TestCodec(t *testing.T) { require.Equal(t, "aac", c.Name()) require.Equal(t, "aac", c.String()) - c = astiav.FindEncoder(astiav.CodecIDH264) + c = astiav.FindEncoder(astiav.CodecIDMjpeg) require.NotNil(t, c) require.False(t, c.IsDecoder()) require.True(t, c.IsEncoder()) - require.Contains(t, c.PixelFormats(), astiav.PixelFormatNv12) - require.Contains(t, c.PixelFormats(), astiav.PixelFormatYuv420P) + require.Contains(t, c.PixelFormats(), astiav.PixelFormatYuvj420P) require.Nil(t, c.SampleFormats()) - require.Contains(t, c.Name(), "264") - require.Contains(t, c.String(), "264") + require.Contains(t, c.Name(), "mjpeg") + require.Contains(t, c.String(), "mjpeg") c = astiav.FindEncoderByName("mjpeg") require.NotNil(t, c)