[FFmpeg-devel] [PATCH] Added more tests to libswscale/utils.c
Michael Niedermayer
michael at niedermayer.cc
Sun Mar 27 21:00:32 CEST 2016
On Sun, Mar 27, 2016 at 04:39:39PM +0000, Petru Rares Sincraian wrote:
>
> - Added test for: swscale_license()
> - Added test for: alphaless_fmt()
> - Added test for: alloc_gamma_tbl()
[...]
> +static void test_alphaless_fmt(void)
> +{
> + int result;
> +
> + result = alphaless_fmt(AV_PIX_FMT_ARGB) == AV_PIX_FMT_RGB24;
> + printf("AV_PIX_FMT_ARGB == AV_PIX_FMT_RGB24 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_RGBA) == AV_PIX_FMT_RGB24;
> + printf("AV_PIX_FMT_RGBA == AV_PIX_FMT_RGB24 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_ABGR) == AV_PIX_FMT_BGR24;
> + printf("AV_PIX_FMT_ABGR == AV_PIX_FMT_BGR24 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_BGRA) == AV_PIX_FMT_BGR24;
> + printf("AV_PIX_FMT_BGRA == AV_PIX_FMT_BGR24 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YA8) == AV_PIX_FMT_GRAY8;
> + printf("AV_PIX_FMT_YA8 == AV_PIX_FMT_GRAY8 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P) == AV_PIX_FMT_YUV420P;
> + printf("AV_PIX_FMT_YUVA420P == AV_PIX_FMT_YUV420P ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P) == AV_PIX_FMT_YUV422P;
> + printf("AV_PIX_FMT_YUVA422P == AV_PIX_FMT_YUV422P ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P) == AV_PIX_FMT_YUV444P;
> + printf("AV_PIX_FMT_YUVA444P == AV_PIX_FMT_YUV444P ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_GBRAP) == AV_PIX_FMT_GBRP;
> + printf("AV_PIX_FMT_GBRAP == AV_PIX_FMT_GBRP ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_GBRAP12LE) == AV_PIX_FMT_GBRP12;
> + printf("AV_PIX_FMT_GBRAP12LE == AV_PIX_FMT_GBRP12 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_GBRAP12BE) == AV_PIX_FMT_GBRP12;
> + printf("AV_PIX_FMT_GBRAP12BE == AV_PIX_FMT_GBRP12 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_RGBA64LE) == AV_PIX_FMT_RGB48;
> + printf("AV_PIX_FMT_RGBA64LE == AV_PIX_FMT_RGB48 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_RGBA64BE) == AV_PIX_FMT_RGB48;
> + printf("AV_PIX_FMT_RGBA64BE == AV_PIX_FMT_RGB48 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_BGRA64LE) == AV_PIX_FMT_BGR48;
> + printf("AV_PIX_FMT_BGRA64LE == AV_PIX_FMT_BGR48 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_BGRA64BE) == AV_PIX_FMT_BGR48;
> + printf("AV_PIX_FMT_BGRA64BE == AV_PIX_FMT_BGR48 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YA16BE) == AV_PIX_FMT_GRAY16;
> + printf("AV_PIX_FMT_YA16LE == AV_PIX_FMT_GRAY16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YA16LE) == AV_PIX_FMT_GRAY16;
> + printf("AV_PIX_FMT_YA16LE == AV_PIX_FMT_GRAY16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P9BE) == AV_PIX_FMT_YUV420P9;
> + printf("AV_PIX_FMT_YUVA420P9BE == AV_PIX_FMT_YUV420P9 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P9BE) == AV_PIX_FMT_YUV422P9;
> + printf("AV_PIX_FMT_YUVA422P9BE == AV_PIX_FMT_YUV422P9 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P9BE) == AV_PIX_FMT_YUV444P9;
> + printf("AV_PIX_FMT_YUVA444P9BE == AV_PIX_FMT_YUV444P9 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P9LE) == AV_PIX_FMT_YUV420P9;
> + printf("AV_PIX_FMT_YUVA420P9LE == AV_PIX_FMT_YUV420P9 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P9LE) == AV_PIX_FMT_YUV422P9;
> + printf("AV_PIX_FMT_YUVA422P9LE == AV_PIX_FMT_YUV422P9 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P9LE) == AV_PIX_FMT_YUV444P9;
> + printf("AV_PIX_FMT_YUVA444P9LE == AV_PIX_FMT_YUV444P9 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P10BE) == AV_PIX_FMT_YUV420P10;
> + printf("AV_PIX_FMT_YUVA420P10BE == AV_PIX_FMT_YUV420P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P10BE) == AV_PIX_FMT_YUV422P10;
> + printf("AV_PIX_FMT_YUVA422P10BE == AV_PIX_FMT_YUV422P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P10BE) == AV_PIX_FMT_YUV444P10;
> + printf("AV_PIX_FMT_YUVA444P10BE == AV_PIX_FMT_YUV444P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P10LE) == AV_PIX_FMT_YUV420P10;
> + printf("AV_PIX_FMT_YUVA420P10LE == AV_PIX_FMT_YUV420P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P10LE) == AV_PIX_FMT_YUV422P10;
> + printf("AV_PIX_FMT_YUVA422P10LE == AV_PIX_FMT_YUV422P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P10LE) == AV_PIX_FMT_YUV444P10;
> + printf("AV_PIX_FMT_YUVA444P10LE == AV_PIX_FMT_YUV444P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P10LE) == AV_PIX_FMT_YUV444P10;
> + printf("AV_PIX_FMT_YUVA444P10LE == AV_PIX_FMT_YUV444P10 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P16BE) == AV_PIX_FMT_YUV420P16;
> + printf("AV_PIX_FMT_YUVA420P16BE == AV_PIX_FMT_YUV420P16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P16BE) == AV_PIX_FMT_YUV422P16;
> + printf("AV_PIX_FMT_YUVA422P16BE == AV_PIX_FMT_YUV422P16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P16BE) == AV_PIX_FMT_YUV444P16;
> + printf("AV_PIX_FMT_YUVA444P16BE == AV_PIX_FMT_YUV444P16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA420P16LE) == AV_PIX_FMT_YUV420P16;
> + printf("AV_PIX_FMT_YUVA420P16LE == AV_PIX_FMT_YUV420P16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA422P16LE) == AV_PIX_FMT_YUV422P16;
> + printf("AV_PIX_FMT_YUVA422P16LE == AV_PIX_FMT_YUV422P16 ? %d\n", result);
> +
> + result = alphaless_fmt(AV_PIX_FMT_YUVA444P16LE) == AV_PIX_FMT_YUV444P16;
> + printf("AV_PIX_FMT_YUVA444P16LE == AV_PIX_FMT_YUV444P16 ? %d\n", result);
> +
> +}
This code needs updating everytime a format is added, this is not ok
there is noone who will update this
[...]
> diff --git a/tests/ref/fate/utils b/tests/ref/fate/utils
> new file mode 100644
> index 0000000..d3268aa
> --- /dev/null
> +++ b/tests/ref/fate/utils
> @@ -0,0 +1,143 @@
> +Testing swscale_license()
> +LGPL version 2.1 or later
this will fail with --enable-gpl
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160327/940c4b2d/attachment.sig>
More information about the ffmpeg-devel
mailing list