Extending torture_assert_* macros

Kamen Mazdrashki kamenim at samba.org
Mon Jul 5 19:50:19 MDT 2010


On Tue, Jul 6, 2010 at 01:09, Andrew Bartlett <abartlet at samba.org> wrote:

> On Mon, 2010-07-05 at 16:34 +0300, Kamen Mazdrashki wrote:
> > The thing is that I don't quite like to introduce a whole new public
> > function
> > just to be able to format messages in torture_assert_* macros.
>
> Why not?  What is the cost here?
>

No cost actually, just my inconvenience - I would prefer such a function
to be really public (perhaps move it into lib/util/util_str.c - someone may
find it useful).


>
> > Does anyone has an idea how to achieve same effect without
> > implementing new function?
>
> This approach, and the patches you propose, look reasonable to me.  The
> only thing I would say is to convert all the existing tortore_assert
> callers, so we don't have a special _fmt variant.
>

I think this is the right thing to be done. I am afraid this may
become quite big patch though.
Anyway, I will certainly go that way then.


> The only comment I would make is:  Don't declare:
>  const char *cmt = torture_format_msg_helper cmt_args; \
>
> as 'const char *', as you need to talloc_free it shortly.  Also, choose
> a more unusual name, as you don't want to get warnings from shadowing a
> local variable in the caller.


I thought I've fixed this before pushing :). Thanks.


-- 
CU,
Kamen Mazdrashki
Samba Team                                            http://samba.org
http://gitweb.samba.org/?p=kamenim/samba.git;a=summary


More information about the samba-technical mailing list