diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-03-19 20:08:46 +0100 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-03-20 18:16:53 +0100 |
commit | d0bd87612f410a723d5ddb3001e805485e3efb4f (patch) | |
tree | 0733aab0dbf305965b0973094e75a7ee6f4ab732 /lib/efi_selftest/efi_selftest_hii.c | |
parent | 1646e0928c8eb052bfa2283a6ab8d9f2a92a10e9 (diff) |
efi_selftest: fix test_hii_string_get_string()
The check testing the string result of get_string() returned the wrong
result. The result was ignored.
Use efi_st_strcmp_16_8() for the string comparison.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_selftest/efi_selftest_hii.c')
-rw-r--r-- | lib/efi_selftest/efi_selftest_hii.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c index 8a0b3bc353..f4b70f7950 100644 --- a/lib/efi_selftest/efi_selftest_hii.c +++ b/lib/efi_selftest/efi_selftest_hii.c @@ -783,19 +783,10 @@ static int test_hii_string_get_string(void) goto out; } -#if 1 - u16 *c1, *c2; - - for (c1 = string, c2 = L"Japanese"; *c1 == *c2; c1++, c2++) - ; - if (!*c1 && !*c2) - result = EFI_ST_SUCCESS; - else - result = EFI_ST_FAILURE; -#else - /* TODO: %ls */ - efi_st_printf("got string is %s (can be wrong)\n", string); -#endif + if (efi_st_strcmp_16_8(string, "Japanese")) { + efi_st_error("get_string returned incorrect string\n"); + goto out; + } result = EFI_ST_SUCCESS; |