* [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
* Re: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: setting key toggle state may be unsupported
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
0 siblings, 0 replies; 2+ messages in thread
From: Eric Jin @ 2019-09-11 2:20 UTC (permalink / raw)
To: Heinrich Schuchardt, EDK II Development
Cc: Supreeth Venkatesh, Stephano Cetola
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.glpk@gmx.de>
Sent: Thursday, September 5, 2019 5:34 AM
To: EDK II Development <devel@edk2.groups.io>
Cc: Jin, Eric <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
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/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
^ permalink raw reply [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