diff options
author | Andre Przywara <andre.przywara@arm.com> | 2024-03-16 22:50:22 +0100 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2024-03-21 06:56:13 +0100 |
commit | 33b28998119004f89a662fb3f96e49d0bd9b99a0 (patch) | |
tree | f33967996d84cc8d816da2f5ee7f1cf4041fc14b /lib/efi_selftest/efi_selftest_textoutput.c | |
parent | 4dd134c0c7b89573a7469893941f63751e137b47 (diff) |
efi_selftest: Add box drawing character selftest
UEFI applications rely on Unicode output capability, and might use that
for drawing pseudo-graphical interfaces using Unicode defined box
drawing characters.
Add a simple test to display the most basic box characters, which would
need to be checked manually on the screen for correctness.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_selftest/efi_selftest_textoutput.c')
-rw-r--r-- | lib/efi_selftest/efi_selftest_textoutput.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest/efi_selftest_textoutput.c index 21a6e1c842d..889b2678ff5 100644 --- a/lib/efi_selftest/efi_selftest_textoutput.c +++ b/lib/efi_selftest/efi_selftest_textoutput.c @@ -46,6 +46,20 @@ static int execute(void) u"U+03C2 \u03C2 - Greek small letter final sigma\n" u"U+1F19 \u1F19 - Greek capital letter epsilon with dasia\n"; + const u16 boxes[] = + u"This should render as four boxes with text\n" + u"\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" + u"\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500" + u"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502" + u" left top \u2502 right top \u2502\n\u251c\u2500" + u"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" + u"\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" + u"\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 " + u"left bottom \u2502 right bottom \u2502\n\u2514\u2500\u2500\u2500" + u"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534" + u"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" + u"\u2500\u2500\u2500\u2500\u2518\n"; + /* SetAttribute */ efi_st_printf("\nColor palette\n"); for (foreground = 0; foreground < 0x10; ++foreground) { @@ -140,6 +154,12 @@ static int execute(void) return EFI_ST_FAILURE; } efi_st_printf("\n"); + ret = con_out->output_string(con_out, boxes); + if (ret != EFI_ST_SUCCESS) { + efi_st_error("OutputString failed for box drawing chars\n"); + return EFI_ST_FAILURE; + } + efi_st_printf("\n"); return EFI_ST_SUCCESS; } |