[PATCH v1 1/2] test: fix print_guid()
Heinrich Schuchardt
xypron.glpk at gmx.de
Tue Apr 15 15:25:52 CEST 2025
On 15.04.25 14:53, Jerome Forissier wrote:
> The %pUs format specifier prints the system partition GUID as "System
> Partition" if PARTITION_TYPE_GUID is disabled but either CMD_EFIDEBUG
> or EFI are enabled. See list_guid[] in lib/uuid.c. Fix the print_guid()
> unit test accordingly.
>
> Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
> ---
>
> test/common/print.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/test/common/print.c b/test/common/print.c
> index e3711b10809..574c84b2eee 100644
> --- a/test/common/print.c
> +++ b/test/common/print.c
> @@ -47,6 +47,8 @@ static int print_guid(struct unit_test_state *uts)
> sprintf(str, "%pUs", guid_esp);
> if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID)) { /* brace needed */
I would not know why a brace should be needed for a define using
{( some expressions }).
The problem should be resolved since fa847bb409d6 ("test: Wrap assert
macros in ({ ... }) and fix missing semicolons").
> ut_asserteq_str("system", str);
> + } else if (IS_ENABLED(CONFIG_CMD_EFIDEBUG) || IS_ENABLED(CONFIG_EFI)) {
> + ut_asserteq_str("System Partition", str);
Printing two different strings depending on configuration settings is
not very helpful for users. Can we print "ESP" in all cases, please?
Best regards
Heinrich
> } else {
> ut_asserteq_str("c12a7328-f81f-11d2-ba4b-00a0c93ec93b", str);
> }
More information about the U-Boot
mailing list