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