Hi Heinrich,

It is reasonable to accept the EFI_UNSUPPORTED. I agree.
The patch had better adjust the StandardLib->RecordMessage to 
StandardLib->RecordAssertion, and the AssertionType is 
EFI_TEST_ASSERTION_WARNING.
It gives SCT user a chance to notice this(not silence it) to judge the issue is 
reasonable or not.

  if (Status == EFI_UNSUPPORTED) {
    AssertionType = EFI_TEST_ASSERTION_WARNING;
  } else {
    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
             );

What is your opinion on this?

Best Regards
Eric

-----Original Message-----
From: Heinrich Schuchardt <xypron.g...@gmx.de> 
Sent: Thursday, September 5, 2019 5:34 AM
To: EDK II Development <devel@edk2.groups.io>
Cc: Jin, Eric <eric....@intel.com>; Supreeth Venkatesh 
<supreeth.venkat...@arm.com>; Stephano Cetola 
<stephano.cet...@linux.intel.com>; Heinrich Schuchardt <xypron.g...@gmx.de>
Subject: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: setting key toggle state may 
be unsupported

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.g...@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/Black
+++ BoxTest/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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47094): https://edk2.groups.io/g/devel/message/47094
Mute This Topic: https://groups.io/mt/33143842/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to