[PATCH] bdinfo: Correct use of assertions
Marek Vasut
marex at denx.de
Wed Jul 12 03:49:01 CEST 2023
On 7/12/23 02:24, Simon Glass wrote:
> Hi Marek,
Hi,
> On Tue, 11 Jul 2023 at 17:10, Marek Vasut <marex at denx.de> wrote:
>>
>> On 7/12/23 00:51, Simon Glass wrote:
>>> This test was written for the incorrect use of assertions. Update it to
>>> build with the previous approach, where tests fail at the first
>>> assertion.
>>
>> So basically ut_assert_nextline() does not automatically bail, you have
>> to make it expand to return -ERRNO and check for that errno again with
>> ut_assertok() at the callsite ?
>
> Yes, or any non-zero value. The call stack unwinds since each function
> that fails returns a non-zero value.
It would be nice to spell this out explicitly in the commit message.
This behavior really is inobvious.
More information about the U-Boot
mailing list