[LTP] [PATCH v2 2/3] Rewrite process_vm_readv03.c test with new LTP API
Cyril Hrubis
chrubis@suse.cz
Fri Feb 11 14:57:53 CET 2022
Hi!
> > for (i = 0; i < arr_sz - 1; i++) {
> > - bufsz_single = rand() % (bufsz_left / 2) + 1;
> > - arr[i] = bufsz_single;
> > - bufsz_left -= bufsz_single;
> > + int mod = MAX(1, (bufsz_left - arr_sz) / 2);
> > +
> > + arr[i] = rand() % mod + 1;
> ^
> Haven't we discussed that passing
> zero sized buffer will actually
> test some corner cases?
>
> We should just keep the original code here and just adjust the
> allocation of the buffers as:
Just to be clear, with 'the original' I mean the version you had in the
previous version of the patch.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list