[FFmpeg-devel] [PATCH] remove unused and broken test program in libavutil/base64.c
Michael Niedermayer
michaelni
Wed Jan 28 23:24:39 CET 2009
On Wed, Jan 28, 2009 at 11:02:32PM +0100, Stefano Sabatini wrote:
> On date Wednesday 2009-01-28 20:58:32 +0100, Michael Niedermayer encoded:
> > On Wed, Jan 28, 2009 at 08:44:09PM +0100, Stefano Sabatini wrote:
> [...]
> > > if (!av_base64_encode(encoded, sizeof(encoded), data, data_size)) {
> > > printf("failed: cannot encode the input data\n");
> > > numerr++;
> > > } else {
> > > int size = data_size + 10; // try without 10 as well
> > > uint8_t *data2 = av_malloc(size);
> > > if (data2) {
> > > int data2_size = av_base64_decode(data2, encoded, size);
> > > if (data2_size < 0) {
> > > printf("failed: cannot decode the encoded string '%s'\n", encoded);
> > > numerr++;
> > > } else if (data2_size != data_size) {
> > > printf("failed: decoded/encoded size mismatch (%d != %d)\n", data2_size, data_size);
> > > } else {
> > > if (memcmp(data2, data, data_size)) {
> > > printf("failed: data differs!\n");
> > > numerr++;
> > > } else {
> > > printf("passed!\n");
> > > }
> > > }
> > > av_free(data2);
> > > }
> > > }
> > > av_free(data);
> >
> > duplicate encode/decode test
>
> New round:
the code is not factorized out, its still containing 2 seperate pages
of code that check equality and print stuff
you want a function, a single function that decodes, encodes, tests, and
prints that then is feeded with random and not random data
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20090128/d39f1db6/attachment.pgp>
More information about the ffmpeg-devel
mailing list