[LTP] [PATCH v2] open08: rewrite to newlib
Li Wang
liwang@redhat.com
Fri Jun 15 10:16:13 CEST 2018
On Fri, Jun 15, 2018 at 2:11 PM, Jan Stancek <jstancek@redhat.com> wrote:
>
>> void verify_open(unsigned int i)
>> {
>> - if (tcases[i].setup)
>> - tcases[i].setup(&tcases[i]);
>> + if (i == ARRAY_SIZE(tcases) - 1) {
>
> It's same as hardcoding index to array - if someone adds
> new testcase it breaks.
Yes, to avoid that, new testcase should not be as the last one.
>
> But we could set it to some special value (NULL) and check all cases against that.
> If it's NULL, then make a bad_addr.
Agreed.
--
Regards,
Li Wang
More information about the ltp
mailing list