summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-11-01 10:56:37 -0500
committerTom Rini <trini@konsulko.com>2020-11-01 10:56:37 -0500
commit41cab8edbcf38bce5cddf54957618dd4205d008f (patch)
treeefe29a6e552133360d8303fc44b025ecf2cc1b95 /test
parent2c31d7e746766f47a007f39c030706e493a9cc77 (diff)
parentaf11423eb06d68784647b879cac57d7b6619d095 (diff)
Merge tag 'efi-2020-01-rc2-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-01-rc2 (2) The series contains the following enhancements * preparatory patches for UEFI capsule updates * initialization of the emulated RTC using an environment variable and a bug fix * If DisconnectController() is called for a child controller that is the only child of the driver, the driver must be disconnected.
Diffstat (limited to 'test')
-rw-r--r--test/unicode_ut.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unicode_ut.c b/test/unicode_ut.c
index 26d96336f3..33fc8b0ee1 100644
--- a/test/unicode_ut.c
+++ b/test/unicode_ut.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <charset.h>
#include <command.h>
+#include <efi_loader.h>
#include <errno.h>
#include <log.h>
#include <malloc.h>
@@ -594,6 +595,24 @@ static int unicode_test_u16_strsize(struct unit_test_state *uts)
}
UNICODE_TEST(unicode_test_u16_strsize);
+#ifdef CONFIG_EFI_LOADER
+static int unicode_test_efi_create_indexed_name(struct unit_test_state *uts)
+{
+ u16 buf[16];
+ u16 const expected[] = L"Capsule0AF9";
+ u16 *pos;
+
+ memset(buf, 0xeb, sizeof(buf));
+ pos = efi_create_indexed_name(buf, "Capsule", 0x0af9);
+
+ ut_asserteq_mem(expected, buf, sizeof(expected));
+ ut_asserteq(pos - buf, u16_strnlen(buf, SIZE_MAX));
+
+ return 0;
+}
+UNICODE_TEST(unicode_test_efi_create_indexed_name);
+#endif
+
int do_ut_unicode(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct unit_test *tests = ll_entry_start(struct unit_test, unicode_test);