[PATCH] tiny-printf: Support %i

Marek Vasut marex at denx.de
Tue Apr 14 03:16:09 CEST 2020


On 4/14/20 1:42 AM, Simon Glass wrote:
> Hi Marek,
> 
> On Fri, 10 Apr 2020 at 14:52, Marek Vasut <marex at denx.de> wrote:
>>
>> On 4/10/20 10:47 PM, Simon Glass wrote:
>>> Hi Marek,
>>>
>>> On Fri, 10 Apr 2020 at 12:54, Marek Vasut <marex at denx.de> wrote:
>>>>
>>>> The most basic printf("%i", value) formating string was missing,
>>>> add it for the sake of convenience.
>>>>
>>>> Signed-off-by: Marek Vasut <marex at denx.de>
>>>> Cc: Simon Glass <sjg at chromium.org>
>>>> Cc: Stefan Roese <sr at denx.de>
>>>> ---
>>>>  lib/tiny-printf.c | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> Can you add to the test in print_ut.c?
>>
>> Sure, is that a hard-requirement for such a minor patch ?
>> Is there an example for the other %u / %d variants ?
> 
> I think we should promote adding tests.
> 
> Just add a few lines and then others can contribute more.
> 
> The current tests use sprintf(). But there is a
> ut_check_console_line() that should help. It's really easy to use.
> 
> See here for an example:
> 
> https://gitlab.denx.de/u-boot/custodians/u-boot-dm/-/blob/corp6-working/test/dm/acpi.c#L262

These look like ACPI tests, not printf() tests ?

Also, please answer my question -- there are currently no tests for the
other variants, so you expect me to implement those as well, correct ?


More information about the U-Boot mailing list