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

Michael Niedermayer michaelni
Wed Jun 16 23:22:47 CEST 2010


On Wed, Jun 16, 2010 at 08:33:26PM +0200, Stefano Sabatini wrote:
> On date Sunday 2010-06-13 02:31:32 +0200, Michael Niedermayer encoded:
> > 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
> 
> Patch updated with minor changes. I don't want to spend more time on
> this, but this may be useful as a basis for improving the current
> test, I'll drop the patch if you don't want this applied.

patch ok but insuffient for reasonable testing of the code.

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- 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/20100616/2c5568ba/attachment.pgp>



More information about the ffmpeg-devel mailing list