[FFmpeg-devel] [PATCH 2/2] Added more tests to libavutil/parseutils.c

Michael Niedermayer michael at niedermayer.cc
Thu Mar 24 04:04:58 CET 2016


On Wed, Mar 23, 2016 at 03:33:02PM +0000, Petru Rares Sincraian wrote:
> 
>     - Added tests for av_find_info_tag().
>     - Added test for av_get_known_color_name()
> ---
>  libavutil/parseutils.c    |  37 ++++++++++++
>  tests/ref/fate/parseutils | 151 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 188 insertions(+)
> 
> diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
> index 43bd4eb..a782ef6 100644
> --- a/libavutil/parseutils.c
> +++ b/libavutil/parseutils.c
> @@ -922,6 +922,38 @@ static void test_av_parse_time(void)
>      }
>  }
>  
> +static void test_av_get_known_color_name(void)
> +{
> +    int i;
> +    const uint8_t *rgba;
> +    const char *color;
> +
> +    for (i = 0; i < FF_ARRAY_ELEMS(color_table); ++i) {
> +        color = av_get_known_color_name(i, &rgba);

> +        if (color) {
> +        printf("%s -> R(%d) G(%d) B(%d) A(%d)\n",
> +                color, rgba[0], rgba[1], rgba[2], rgba[3]);
> +        }
> +        else

that code looks oddly formated


> +            printf("Color ID: %d not found\n", i);
> +    }
> +}
> +
> +static void test_av_find_info_tag(void)
> +{
> +    char args[] = "?tag1=val1&tag2=val2&tag3=val3&tag41=value 41&tag42=random1";
> +    const char *tags[] = {"tag1", "tag2", "tag3", "tag4", "tag41", "41", "random1"};

static const


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- 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/20160324/161e67c3/attachment.sig>


More information about the ffmpeg-devel mailing list