[PATCH 2/2] efi_selftest: add hii database protocol test case

Vincent Stehlé vincent.stehle at arm.com
Tue Dec 13 22:39:10 CET 2022


Add a test for the case when the HII database protocol
get_package_list_handle() function is called with an invalid package list
handle.

Signed-off-by: Vincent Stehlé <vincent.stehle at arm.com>
Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
---
 lib/efi_selftest/efi_selftest_hii.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c
index eaf3b0995d4..8a038d9f534 100644
--- a/lib/efi_selftest/efi_selftest_hii.c
+++ b/lib/efi_selftest/efi_selftest_hii.c
@@ -605,6 +605,16 @@ static int test_hii_database_get_package_list_handle(void)
 		goto out;
 	}
 
+	/* Invalid package list handle. */
+	driver_handle = NULL;
+	ret = hii_database_protocol->get_package_list_handle(
+			hii_database_protocol, NULL, &driver_handle);
+	if (ret != EFI_INVALID_PARAMETER) {
+		efi_st_error("get_package_list_handle returned %u not invalid\n",
+			     (unsigned int)ret);
+		goto out;
+	}
+
 	result = EFI_ST_SUCCESS;
 
 out:
-- 
2.35.1



More information about the U-Boot mailing list