2 * efi_selftest_textoutput
4 * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
6 * SPDX-License-Identifier: GPL-2.0+
8 * Test the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
10 * The following services are tested:
11 * OutputString, TestString, SetAttribute.
14 #include <efi_selftest.h>
19 * @return: EFI_ST_SUCCESS for success
21 static int execute(void)
29 efi_st_printf("\nColor palette\n");
30 for (foreground
= 0; foreground
< 0x10; ++foreground
) {
31 for (background
= 0; background
< 0x80; background
+= 0x10) {
32 attrib
= foreground
| background
;
33 con_out
->set_attribute(con_out
, attrib
);
34 efi_st_printf("%p", (void *)attrib
);
36 con_out
->set_attribute(con_out
, 0);
40 ret
= con_out
->test_string(con_out
,
41 L
" !\"#$%&'()*+,-./0-9:;<=>?@A-Z[\\]^_`a-z{|}~\n");
42 if (ret
!= EFI_ST_SUCCESS
) {
43 efi_st_error("TestString failed for ANSI characters\n");
44 return EFI_ST_FAILURE
;
46 return EFI_ST_SUCCESS
;
49 EFI_UNIT_TEST(textoutput
) = {
50 .name
= "text output",
51 .phase
= EFI_EXECUTE_BEFORE_BOOTTIME_EXIT
,