public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: setting key toggle state may be unsupported
@ 2019-09-04 21:33 Heinrich Schuchardt
  2019-09-11  2:20 ` Eric Jin
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2019-09-04 21:33 UTC (permalink / raw)
  To: EDK II Development
  Cc: Eric Jin, Supreeth Venkatesh, Stephano Cetola,
	Heinrich Schuchardt

It is allowable that a system does not support
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.SetState(). For instance a serial console
would not allow to set toggle keys. In this case do not expect the function
to check its arguments. It will typically directly return EFI_UNSUPPORTED.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 .../SimpleTextInputExBBTestConformance.c      | 37 ++++++++++++-------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestConformance.c
index d997b651..7876d8db 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestConformance.c
@@ -483,22 +483,31 @@ BBTestSetStateConformanceTestCheckpoint1 (
                         );
     }
   }
-  
-  if ( EFI_INVALID_PARAMETER != Status) {
-    AssertionType = EFI_TEST_ASSERTION_FAILED;
+
+  if (Status == EFI_UNSUPPORTED) {
+    StandardLib->RecordMessage(
+                   StandardLib,
+                   EFI_VERBOSE_LEVEL_QUIET,
+                   L"SetState isn't supported, Status - %r\n",
+                   Status
+                   );
   } else {
-    AssertionType = EFI_TEST_ASSERTION_PASSED;
+    if ( EFI_INVALID_PARAMETER != Status) {
+      AssertionType = EFI_TEST_ASSERTION_FAILED;
+    } else {
+      AssertionType = EFI_TEST_ASSERTION_PASSED;
+    }
+    StandardLib->RecordAssertion (
+             StandardLib,
+             AssertionType,
+             gSimpleTextInputExBBTestConformanceAssertionGuid003,
+             L"SIMPLE_TEXT_INPUT_EX_PROTOCOL.SetState - SetState() returns EFI_INVALID_PARAMETER with KeyToggleState being NULL.",
+             L"%a:%d: Status - %r",
+             __FILE__,
+             (UINTN)__LINE__,
+             Status
+             );
   }
-  StandardLib->RecordAssertion (
-           StandardLib,
-           AssertionType,
-           gSimpleTextInputExBBTestConformanceAssertionGuid003,
-           L"SIMPLE_TEXT_INPUT_EX_PROTOCOL.SetState - SetState() returns EFI_INVALID_PARAMETER with KeyToggleState being NULL.",
-           L"%a:%d: Status - %r",
-           __FILE__,
-           (UINTN)__LINE__,
-           Status
-           );
 
   return EFI_SUCCESS;
 }
-- 
2.23.0.rc1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-11  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-04 21:33 [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: setting key toggle state may be unsupported Heinrich Schuchardt
2019-09-11  2:20 ` Eric Jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox