[FFmpeg-devel] [PATCH 1/6] Add more tests to eval, help detecting more apparent errors.

Michael Niedermayer michaelni
Sun Jun 13 02:31:32 CEST 2010


On Sun, Jun 13, 2010 at 12:38:03AM +0200, Stefano Sabatini wrote:
> ---
>  libavutil/eval.c |   38 ++++++++++++++++++++++++++++++++++++++
>  1 files changed, 38 insertions(+), 0 deletions(-)
> 
> diff --git a/libavutil/eval.c b/libavutil/eval.c
> index 59ebd94..cfe71e1 100644
> --- a/libavutil/eval.c
> +++ b/libavutil/eval.c
> @@ -526,6 +526,44 @@ int main(void)
>  {
>      int i;
>      double d;
> +    const char **expr, *exprs[] = {
> +        "",
> +        "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
> +        "80G/80Gi"
> +        "1k",
> +        "1Gi",
> +        "1gi",
> +        "1GiFoo",
> +        "1k+1k",
> +        "1Gi*3foo",
> +        "foo",
> +        "foo(",
> +        "foo()",
> +        "foo)",
> +        "sin",
> +        "sin(",
> +        "sin()",
> +        "sin)",
> +        "sin 10",
> +        "sin(1,2,3)",
> +        "sin(1 )",
> +        "1",
> +        "1foo",
> +        "bar + PI + E + 100f*2 + foo",
> +        "foo(1, 2)",
> +        "1gi",
> +        "1Gi",
> +        NULL

thats a huge number of invalid expressions but the only no trivial valid
is copied from the test below

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100613/6227bb5c/attachment.pgp>



More information about the ffmpeg-devel mailing list