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

How to recognize that an SVN_ERR_ASSERT() triggered Re: svn_error_purge_tracing() and clearing the errors Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 24 Dec 2010 10:55:03 +0200

Daniel Shahaf wrote on Fri, Dec 24, 2010 at 10:48:24 +0200:
> Blair Zajac wrote on Thu, Dec 23, 2010 at 17:09:31 -0800:
> > On 12/23/10 3:01 AM, Daniel Shahaf wrote:
> >> I've made a quick sketch --- looks good?
> >
> > The suggestions look good.
> >
> > We could add some more tests, checking the behavior with SVN_NO_ERROR
> > input and one where all errors are tracing, which should return an error
> > from SVN_ERR_ASSERT().
> >
>
> I'm not sure about the 'assert' part (both due to the "testing that it
> has asserted" issue and due to the fact that it's mathematiclaly
> legitimaste to return an empty chain (aka SVN_NO_ERROR) in that case).

BTW, the malfunction API only promises an error in the category
SVN_ERR_MALFUNC_CATEGORY_START, so I have assumed we should have
a macro to decide whether an error code is in a given category:

  #define SVN_ERROR_IN_CATEGORY(err, category) \
    ((category) == (((err) ? (err)->apr_err : 0) / SVN_ERR_CATEGORY_SIZE) * SVN_ERR_CATEGORY_SIZE)

  {
    if (SVN_ERROR_IN_CATEGORY(err, SVN_ERR_MALFUNC_CATEGORY_START)) { ... }
  }
Received on 2010-12-24 09:58:15 CET

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