aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-01-22 15:43:36 -0500
committerTom Rini <trini@konsulko.com>2022-01-22 15:43:36 -0500
commitda158ec5f2db86d88a631c05c540ba5ee1937a77 (patch)
tree2aec2712bc2db6417fc9e5660b8a5c2e7b04ecee /test
parente6786b0354372c8a68d01e4d633a19cdce373b70 (diff)
parentf5e9035043fb48baea93ccb3165e75f486906213 (diff)
downloadu-boot-da158ec5f2db86d88a631c05c540ba5ee1937a77.zip
u-boot-da158ec5f2db86d88a631c05c540ba5ee1937a77.tar.gz
u-boot-da158ec5f2db86d88a631c05c540ba5ee1937a77.tar.bz2
Merge tag 'efi-2022-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efiWIP/22Jan2022
Pull request for efi-2022-04-rc1-2 Documentation: * describe printf() format codes UEFI * enable more algorithms for UEFI image verification, e.g. SHA256-RSA2048 General * simplify printing short texts for GUIDs * provide a unit test for printing GUIDs
Diffstat (limited to 'test')
-rw-r--r--test/print_ut.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/print_ut.c b/test/print_ut.c
index 7b2e7bb..194387f 100644
--- a/test/print_ut.c
+++ b/test/print_ut.c
@@ -30,17 +30,29 @@ static int print_guid(struct unit_test_state *uts)
unsigned char guid[16] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
};
+ unsigned char guid_esp[16] = {
+ 0x28, 0x73, 0x2a, 0xc1, 0x1f, 0xf8, 0xd2, 0x11,
+ 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B
+ };
char str[40];
int ret;
sprintf(str, "%pUb", guid);
- ut_assertok(strcmp("01020304-0506-0708-090a-0b0c0d0e0f10", str));
+ ut_asserteq_str("01020304-0506-0708-090a-0b0c0d0e0f10", str);
sprintf(str, "%pUB", guid);
- ut_assertok(strcmp("01020304-0506-0708-090A-0B0C0D0E0F10", str));
+ ut_asserteq_str("01020304-0506-0708-090A-0B0C0D0E0F10", str);
sprintf(str, "%pUl", guid);
- ut_assertok(strcmp("04030201-0605-0807-090a-0b0c0d0e0f10", str));
+ ut_asserteq_str("04030201-0605-0807-090a-0b0c0d0e0f10", str);
+ sprintf(str, "%pUs", guid);
+ ut_asserteq_str("04030201-0605-0807-090a-0b0c0d0e0f10", str);
sprintf(str, "%pUL", guid);
- ut_assertok(strcmp("04030201-0605-0807-090A-0B0C0D0E0F10", str));
+ ut_asserteq_str("04030201-0605-0807-090A-0B0C0D0E0F10", str);
+ sprintf(str, "%pUs", guid_esp);
+ if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID)) { /* brace needed */
+ ut_asserteq_str("system", str);
+ } else {
+ ut_asserteq_str("c12a7328-f81f-11d2-ba4b-00a0c93ec93b", str);
+ }
ret = snprintf(str, 4, "%pUL", guid);
ut_asserteq(0, str[3]);
ut_asserteq(36, ret);