[PATCH] tiny-printf: Support %i

Simon Glass sjg at chromium.org
Tue Apr 14 01:42:34 CEST 2020


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

Regards,
Simon


More information about the U-Boot mailing list