[PATCH 1/1] test: print_printf() must check availability of %ls
Ilias Apalodimas
ilias.apalodimas at linaro.org
Thu Nov 7 10:46:25 CET 2024
On Sun, 3 Nov 2024 at 20:46, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> Availability of %ls in printf() depends on having
> CONFIG_EFI_LOADER or CONFIG_EFI_APP.
>
> Respect this when testing.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> test/print_ut.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/test/print_ut.c b/test/print_ut.c
> index f5e607b21a3..bffd446f6c0 100644
> --- a/test/print_ut.c
> +++ b/test/print_ut.c
> @@ -118,8 +118,10 @@ static int print_printf(struct unit_test_state *uts)
> snprintf(str, 0, "testing none");
> ut_asserteq('x', *str);
>
> - sprintf(big_str, "_%ls_", u"foo");
> - ut_assertok(strcmp("_foo_", big_str));
> + if (CONFIG_IS_ENABLED(EFI_LOADER) || IS_ENABLED(CONFIG_EFI_APP)) {
> + sprintf(big_str, "_%ls_", u"foo");
> + ut_assertok(strcmp("_foo_", big_str));
> + }
>
> /* Test the banner function */
> s = display_options_get_banner(true, str, sizeof(str));
> --
> 2.45.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
More information about the U-Boot
mailing list