mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
efi_selftest: test hii keyboard layouts more
The HII database test for keyboard layouts register two package lists with two keyboard layouts each, but the test verifies only the GUID of the first keyboard layout. This does not catch the bugs happening with the keyboard layouts after the first one in a package. Verify all the keyboard layout GUIDs in the unit test to prevent this. Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Tom Rini <trini@konsulko.com>
This commit is contained in:
committed by
Heinrich Schuchardt
parent
ec95a60d9d
commit
5824ed13bc
@@ -452,8 +452,7 @@ out:
|
|||||||
* test_hii_database_get_keyboard_layout() - test retrieval of keyboard layout
|
* test_hii_database_get_keyboard_layout() - test retrieval of keyboard layout
|
||||||
*
|
*
|
||||||
* This test adds two package lists, each of which has two keyboard layouts
|
* This test adds two package lists, each of which has two keyboard layouts
|
||||||
* and then tries to get a handle to keyboard layout with a specific guid
|
* and then tries to get a handle to every keyboard layout and the current one.
|
||||||
* and the current one.
|
|
||||||
*
|
*
|
||||||
* @Return: status code
|
* @Return: status code
|
||||||
*/
|
*/
|
||||||
@@ -463,7 +462,11 @@ static int test_hii_database_get_keyboard_layout(void)
|
|||||||
struct efi_hii_keyboard_layout *kb_layout;
|
struct efi_hii_keyboard_layout *kb_layout;
|
||||||
u16 kb_layout_size;
|
u16 kb_layout_size;
|
||||||
efi_status_t ret;
|
efi_status_t ret;
|
||||||
int result = EFI_ST_FAILURE;
|
int result = EFI_ST_FAILURE, i;
|
||||||
|
static efi_guid_t *const kb_layout_guids[] = {
|
||||||
|
&kb_layout_guid11, &kb_layout_guid12,
|
||||||
|
&kb_layout_guid21, &kb_layout_guid22
|
||||||
|
};
|
||||||
|
|
||||||
PRINT_TESTNAME;
|
PRINT_TESTNAME;
|
||||||
ret = hii_database_protocol->new_package_list(hii_database_protocol,
|
ret = hii_database_protocol->new_package_list(hii_database_protocol,
|
||||||
@@ -484,33 +487,37 @@ static int test_hii_database_get_keyboard_layout(void)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* specific keyboard_layout(guid11) */
|
/* Verify all keyboard layouts */
|
||||||
kb_layout = NULL;
|
for (i = 0; i < ARRAY_SIZE(kb_layout_guids); i++) {
|
||||||
kb_layout_size = 0;
|
efi_guid_t *kb_layout_guid = kb_layout_guids[i];
|
||||||
ret = hii_database_protocol->get_keyboard_layout(hii_database_protocol,
|
|
||||||
&kb_layout_guid11, &kb_layout_size, kb_layout);
|
kb_layout = NULL;
|
||||||
if (ret != EFI_BUFFER_TOO_SMALL) {
|
kb_layout_size = 0;
|
||||||
efi_st_error("get_keyboard_layout returned %u\n",
|
ret = hii_database_protocol->get_keyboard_layout(hii_database_protocol,
|
||||||
(unsigned int)ret);
|
kb_layout_guid, &kb_layout_size, kb_layout);
|
||||||
goto out;
|
if (ret != EFI_BUFFER_TOO_SMALL) {
|
||||||
}
|
efi_st_error("get_keyboard_layout returned %u\n",
|
||||||
ret = boottime->allocate_pool(EFI_LOADER_DATA, kb_layout_size,
|
(unsigned int)ret);
|
||||||
(void **)&kb_layout);
|
goto out;
|
||||||
if (ret != EFI_SUCCESS) {
|
}
|
||||||
efi_st_error("AllocatePool failed\n");
|
ret = boottime->allocate_pool(EFI_LOADER_DATA, kb_layout_size,
|
||||||
goto out;
|
(void **)&kb_layout);
|
||||||
}
|
if (ret != EFI_SUCCESS) {
|
||||||
ret = hii_database_protocol->get_keyboard_layout(hii_database_protocol,
|
efi_st_error("AllocatePool failed\n");
|
||||||
&kb_layout_guid11, &kb_layout_size, kb_layout);
|
goto out;
|
||||||
if (ret != EFI_SUCCESS) {
|
}
|
||||||
efi_st_error("get_keyboard_layout returned %u\n",
|
ret = hii_database_protocol->get_keyboard_layout(hii_database_protocol,
|
||||||
(unsigned int)ret);
|
kb_layout_guid, &kb_layout_size, kb_layout);
|
||||||
goto out;
|
if (ret != EFI_SUCCESS) {
|
||||||
}
|
efi_st_error("get_keyboard_layout returned %u\n",
|
||||||
ret = boottime->free_pool(kb_layout);
|
(unsigned int)ret);
|
||||||
if (ret != EFI_SUCCESS) {
|
goto out;
|
||||||
efi_st_error("FreePool failed\n");
|
}
|
||||||
goto out;
|
ret = boottime->free_pool(kb_layout);
|
||||||
|
if (ret != EFI_SUCCESS) {
|
||||||
|
efi_st_error("FreePool failed\n");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* current */
|
/* current */
|
||||||
|
|||||||
@@ -428,6 +428,18 @@ static efi_guid_t kb_layout_guid11 =
|
|||||||
EFI_GUID(0x8d40e495, 0xe2aa, 0x4c6f,
|
EFI_GUID(0x8d40e495, 0xe2aa, 0x4c6f,
|
||||||
0x89, 0x70, 0x68, 0x85, 0x09, 0xee, 0xc7, 0xd2);
|
0x89, 0x70, 0x68, 0x85, 0x09, 0xee, 0xc7, 0xd2);
|
||||||
|
|
||||||
|
static efi_guid_t kb_layout_guid12 =
|
||||||
|
EFI_GUID(0x2ae60b3e, 0xb9d6, 0x49d8,
|
||||||
|
0x9a, 0x16, 0xc2, 0x48, 0xf1, 0xeb, 0xa8, 0xdb);
|
||||||
|
|
||||||
|
static efi_guid_t kb_layout_guid21 =
|
||||||
|
EFI_GUID(0xe0f56a1f, 0xdf6b, 0x4a7e,
|
||||||
|
0xa3, 0x9a, 0xe7, 0xa5, 0x19, 0x15, 0x45, 0xd6);
|
||||||
|
|
||||||
|
static efi_guid_t kb_layout_guid22 =
|
||||||
|
EFI_GUID(0x47be6ac9, 0x54cc, 0x46f9,
|
||||||
|
0xa2, 0x62, 0xd5, 0x3b, 0x25, 0x6a, 0x0c, 0x34);
|
||||||
|
|
||||||
static efi_guid_t package_guid =
|
static efi_guid_t package_guid =
|
||||||
EFI_GUID(0x0387c95a, 0xd703, 0x2346,
|
EFI_GUID(0x0387c95a, 0xd703, 0x2346,
|
||||||
0xb2, 0xab, 0xd0, 0xc7, 0xdd, 0x90, 0x44, 0xf8);
|
0xb2, 0xab, 0xd0, 0xc7, 0xdd, 0x90, 0x44, 0xf8);
|
||||||
|
|||||||
Reference in New Issue
Block a user