[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fix svndiff-test and vdelta-test

From: Daniel Berlin <dan_at_dberlin.org>
Date: 2002-02-15 23:39:29 CET

On 15 Feb 2002 cmpilato@collab.net wrote:

> Daniel Berlin <dan@dberlin.org> writes:
>
> > They need to create and pass pools, or else they crash.
>
> Committed, despite a little bug, and no log message from you :-(

Here it is (With all other projects, since there's a changelog file in the
dir, when i diff, the change message gets included, and i just edit out
the +'s in front of the lines):

2002-02-15 Daniel Berlin <dan@dberlin.org>

        * vdelta-test.c (main): Move creation of wpool up a few lines, and
        pass it along to the functions that need a pool, but were being
        passed NULL.

        * svndiff-test.c (main): Create a pool and pass it along to
        functions that want one, to avoid crashing.

>
> > Index: ./svndiff-test.c
> > ===================================================================
> > --- ./svndiff-test.c
> > +++ ./svndiff-test.c Fri Feb 15 16:16:58 2002
> > @@ -21,6 +21,7 @@
> > #include <apr_general.h>
> > #include "svn_base64.h"
> > #include "svn_quoprint.h"
> > +#include "svn_pools.h"
> > #include "svn_delta.h"
> > #include "svn_error.h"
> >
> > @@ -34,28 +35,29 @@
> > svn_txdelta_window_handler_t svndiff_handler;
> > svn_stream_t *encoder;
> > void *svndiff_baton;
> > + apr_pool_t *pool = svn_pool_create (NULL);
> >
> > source_file = fopen (argv[1], "rb");
> > target_file = fopen (argv[2], "rb");
> >
> > apr_initialize();
> > - svn_txdelta (&txdelta_stream, svn_stream_from_stdio (source_file, NULL),
> > - svn_stream_from_stdio (target_file, NULL), NULL);
> > + svn_txdelta (&txdelta_stream, svn_stream_from_stdio (source_file, pool),
> > + svn_stream_from_stdio (target_file, pool), pool);
> >
> > #ifdef QUOPRINT_SVNDIFFS
> > - encoder = svn_quoprint_encode (svn_stream_from_stdio (stdout, NULL), NULL);
> > + encoder = svn_quoprint_encode (svn_stream_from_stdio (stdout, pool), pool);
> > #else
> > - encoder = svn_base64_encode (svn_stream_from_stdio (stdout, NULL), NULL);
> > + encoder = svn_base64_encode (svn_stream_from_stdio (stdout, pool), pool);
> > #endif
> > - svn_txdelta_to_svndiff (encoder, NULL, &svndiff_handler, &svndiff_baton);
> > + svn_txdelta_to_svndiff (encoder, pool, &svndiff_handler, &svndiff_baton, 1);
>
> Whoops! How did that extra "1" get into the call to svn_txdelta_to_svndiff()?

I changed the arguments to take a version number (so you could choose
what svndiff version to use), of course, and forgot the tests used it too,
or else i would have edited it out manually.

--Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:08 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.