test: print_printf() must check availability of %ls

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@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Heinrich Schuchardt 2024-11-03 21:46:42 +01:00 committed by Tom Rini
parent d8c5bcbd22
commit 20b23f049f

View File

@ -115,8 +115,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));