public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Heinrich Schuchardt" <xypron.glpk@gmx.de>
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>,
	Supreeth Venkatesh <supreeth.venkatesh@arm.com>,
	Stephano Cetola <stephano.cetola@linux.intel.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: setting key toggle state may be unsupported
Date: Wed,  4 Sep 2019 23:33:50 +0200	[thread overview]
Message-ID: <20190904213350.1239-1-xypron.glpk@gmx.de> (raw)

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


             reply	other threads:[~2019-09-04 21:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 21:33 Heinrich Schuchardt [this message]
2019-09-11  2:20 ` [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: setting key toggle state may be unsupported Eric Jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190904213350.1239-1-xypron.glpk@gmx.de \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox