[PATCH 11/12] torture: add locking tests for copychunk

Jelmer Vernooij jelmer at samba.org
Thu Nov 8 07:07:05 MST 2012


On Thu, Nov 08, 2012 at 01:32:48PM +0100, David Disseldorp wrote:
> On Thu, 08 Nov 2012 01:44:06 +0100
> Jelmer Vernooij <jelmer at samba.org> wrote:
> 
> > > +	ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
> > > +				   1, /* chunks */
> > > +				   &src_h, 4096, /* src file */
> > > +				   &dest_h, 0,	/* dest file */
> > > +				   &cc_copy,
> > > +				   &ioctl);
> > > +	if (!ok) {
> > > +		return false;
> > > +	}  
> > You probably want to indicate a failure here, either by calling the
> > torture_fail() convenience macro or torture_result(), for which it is a
> > wrapper.
> > 
> > Without this, the testsuite will report the test result as error rather
> > than failure and without a specific reason.
> 
> The test_setup_copy_chunk() error paths already print information
> regarding the failure, I'll change this over anyhow.
Thanks.

The existing code would result in the test breaking with

"error: Unknown error/failure. Missing torture_fail() or torture_assert_*()
call?"

if that code path is hit. The other code paths in this file don't
do this either, and would have the same problem. I just mentioned it
to prevent further cargo culting.

Cheers,

Jelmer


More information about the samba-technical mailing list