From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F394C3DA7D for ; Thu, 5 Jan 2023 14:48:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37506855A8; Thu, 5 Jan 2023 15:48:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id AD34E855A9; Thu, 5 Jan 2023 15:48:33 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id A39698559A for ; Thu, 5 Jan 2023 15:48:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vincent.stehle@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92D9C15BF; Thu, 5 Jan 2023 06:49:11 -0800 (PST) Received: from debian (unknown [10.57.13.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0C9163F71A; Thu, 5 Jan 2023 06:48:28 -0800 (PST) Date: Thu, 5 Jan 2023 15:48:25 +0100 From: Vincent =?utf-8?Q?Stehl=C3=A9?= To: Heinrich Schuchardt Cc: Ilias Apalodimas , u-boot@lists.denx.de, AKASHI Takahiro Subject: Re: [PATCH 2/2] efi_selftest: add hii database protocol test case Message-ID: References: <20221213213910.513801-1-vincent.stehle@arm.com> <20221213213910.513801-3-vincent.stehle@arm.com> <6422b676-877e-ebb8-953e-d653428c6be4@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6422b676-877e-ebb8-953e-d653428c6be4@gmx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Thu, Dec 22, 2022 at 10:45:22AM +0100, Heinrich Schuchardt wrote: Hi Heinrich, Happy new year, and thank you for the reviews. More comments below. > On 12/13/22 22:39, Vincent Stehlé wrote: > > 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é > > Cc: Heinrich Schuchardt > > Cc: Ilias Apalodimas > > --- > > 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) { > > Here it is unclear, if you get EFI_INVALID_PARAMETER because the > PackageListHandle is invalid or DriverHandle is NULL. In principle, the value used to initialize the (output) parameter driver_handle should not affect the test. Also, we are initializing driver_handle in exactly the same way as was done in the previous test, which we know succeeded. Anyway, if you think it makes the test more readable I can change the initialization to something like the following: driver_handle = (efi_handle_t)0x23456789; /* dummy */ > > We should test both cases separately. Would you prefer something like the following couple of tests? /* Invalid package list handle. */ driver_handle = (efi_handle_t)0x23456789; /* dummy */ ret = hii_database_protocol->get_package_list_handle( hii_database_protocol, NULL, &driver_handle); /* Invalid driver handle. */ ret = hii_database_protocol->get_package_list_handle( hii_database_protocol, handle, NULL); I could verify that EFI_INVALID_PARAMETER is indeed returned in both cases. Just let me know and I will post a v2. Best regards, Vincent. > > Best regards > > Heinrich > > > + efi_st_error("get_package_list_handle returned %u not invalid\n", > > + (unsigned int)ret); > > + goto out; > > + } > > + > > result = EFI_ST_SUCCESS; > > > > out: >