Commit d919c4a5 authored by Sunny Wang's avatar Sunny Wang Committed by G Edhaya Chandran
Browse files

uefi-sct/SctPkg: Allow SimpleTextOut SetMode to return EFI_UNSUPPORTED

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3738



The SimpleTestOut test cases don't allow SetMode to return
EFI_UNSUPPORTED, which doesn't comply with UEFI spec.

UEFI spec allows EFI_SIMPLE_TEXT_OUT_PROTOCOL.SetMode function to
return EFI_UNSUPPORTED for the condition below:

if the output devices support 80x50, that is defined to be mode 1.
All other text dimensions supported by the device will follow as
modes 2 and above. If an output device supports modes 2 and above,
but does not support 80x50, then querying for mode 1 will return
EFI_UNSUPPORTED.

Therefore, update the test cases to fix this issue.

Cc: G Edhaya Chandran <edhaya.chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Signed-off-by: Sunny Wang's avatarSunny Wang <sunny.wang@arm.com>
Reviewed-by: G Edhaya Chandran's avatarG Edhaya Chandran <edhaya.chandran@arm.com>
parent 733a11dc
......@@ -2,6 +2,7 @@
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, ARM Limited. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -761,7 +762,11 @@ BBTestSetCursorPositionConformanceAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......
......@@ -2,6 +2,7 @@
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, ARM Limited. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -759,7 +760,11 @@ BBTestSetCursorPositionConformanceAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......
......@@ -2,6 +2,7 @@
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, ARM Limited. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -647,7 +648,11 @@ BBTestResetFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -3150,7 +3155,11 @@ BBTestSetModeFunctionManualTest (
// Return status check
//
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
......@@ -3177,7 +3186,6 @@ BBTestSetModeFunctionManualTest (
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -3989,7 +3997,11 @@ BBTestSetAttributeFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -4547,7 +4559,11 @@ BBTestClearScreenFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -5062,7 +5078,11 @@ BBTestSetCursorPositionFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -5818,7 +5838,11 @@ BBTestEnableCursorFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......
......@@ -2,6 +2,7 @@
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, ARM Limited. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -455,7 +456,11 @@ BBTestResetFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -2738,7 +2743,11 @@ BBTestSetModeFunctionManualTest (
// Return status check
//
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
......@@ -3388,7 +3397,11 @@ BBTestSetAttributeFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -3846,7 +3859,11 @@ BBTestClearScreenFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -4362,7 +4379,11 @@ BBTestSetCursorPositionFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -5058,7 +5079,11 @@ BBTestEnableCursorFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......
......@@ -2,6 +2,7 @@
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, ARM Limited. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -759,7 +760,11 @@ BBTestSetCursorPositionConformanceAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......
......@@ -2,6 +2,7 @@
Copyright 2006 - 2016 Unified EFI, Inc.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, ARM Limited. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
......@@ -455,7 +456,11 @@ BBTestResetFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -2738,7 +2743,11 @@ BBTestSetModeFunctionManualTest (
// Return status check
//
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
......@@ -2986,7 +2995,11 @@ BBTestSetModeFunctionAutoTest (
// Return status check
//
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
......@@ -3388,7 +3401,11 @@ BBTestSetAttributeFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -3846,7 +3863,11 @@ BBTestClearScreenFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -4362,7 +4383,11 @@ BBTestSetCursorPositionFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......@@ -5058,7 +5083,11 @@ BBTestEnableCursorFunctionAutoTest (
//
Status = SimpleOut->SetMode (SimpleOut, Mode);
if (EFI_ERROR(Status)) {
if (EFI_UNSUPPORTED == Status) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment