diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-11-22 13:34:25 +0300 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-11-22 13:54:30 +0300 |
commit | 6717a03d303a12f4852f6a1069b0dffcfdeebb98 (patch) | |
tree | b33c69f815b35137ba78e7f97efe9e4d98d6594d /lib/efi_selftest | |
parent | caf29d1e6498bca1f4e98864b0c7a96976a14f20 (diff) | |
download | u-boot-6717a03d303a12f4852f6a1069b0dffcfdeebb98.tar.xz |
efi_selftest: Improve the FatToStr() unit test
Add a test with a character >= 0x80.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_selftest')
-rw-r--r-- | lib/efi_selftest/efi_selftest_unicode_collation.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/efi_selftest/efi_selftest_unicode_collation.c b/lib/efi_selftest/efi_selftest_unicode_collation.c index c63a1b51e4..11050a37cf 100644 --- a/lib/efi_selftest/efi_selftest_unicode_collation.c +++ b/lib/efi_selftest/efi_selftest_unicode_collation.c @@ -184,6 +184,18 @@ static int test_fat_to_str(void) return EFI_ST_FAILURE; } + boottime->set_mem(str, sizeof(str), 0); + unicode_collation_protocol->fat_to_str(unicode_collation_protocol, 13, + "Kafb\240tur\000xyz", str); + if (str[10]) { + efi_st_error("fat_to_str returned to many characters\n"); + return EFI_ST_FAILURE; + } + if (efi_st_strcmp_16_8(str, "Kafb\341tur")) { + efi_st_error("fat_to_str returned \"%ps\"\n", str); + return EFI_ST_FAILURE; + } + return EFI_ST_SUCCESS; } |