]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: print_printf() must check availability of %ls
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 3 Nov 2024 20:46:42 +0000 (21:46 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 15 Nov 2024 00:14:06 +0000 (18:14 -0600)
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>
test/common/print.c

index f1eb9072d97a6c1b2995d1298fd3b2542df1c23f..464e425edee57189a9696a16a119ad6fbb7d6160 100644 (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));