public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-test 1/1] uefi-sct/SctPkg: fix BuildAtaDeviceNode()
@ 2021-03-31 15:38 Heinrich Schuchardt
  2021-04-05 15:45 ` [edk2-devel] " G Edhaya Chandran
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2021-03-31 15:38 UTC (permalink / raw)
  To: EDK II Development
  Cc: Eric Jin, G Edhaya Chandran, Barton Gao, Arvin Chen,
	Samer El-Haj-Mahmoud, Heinrich Schuchardt

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

When BuildAtaDeviceNode() is called with L"Ata(0,0,0)" it creates a node
Ata(1,1,0). This leads to test to an assertion failed test result

    ../DevicePathToTextBBTestFunction.c:332:
    Convert result: Ata(0,0,0) - Expected: Ata(Primary,Master,0)

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 .../BlackBoxTest/DevicePathToTextBBTestMain.c             | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
index 7cf473d30643..59f9cc71831b 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
@@ -1162,9 +1162,9 @@ BuildAtaDeviceNode (

   Status = GetNextRequiredParam(&TextDeviceNode, L"Controller", &ParamIdentifierStr, &ParamIdentifierVal);
   if ((!EFI_ERROR(Status)) && (ParamIdentifierVal != NULL)) {
-  	if ((SctStrCmp (ParamIdentifierVal, L"Primary") == 0) || (SctStrCmp(ParamIdentifierVal, L"0"))) {
+    if ((SctStrCmp (ParamIdentifierVal, L"Primary") == 0) || (SctStrCmp(ParamIdentifierVal, L"0" == 0))) {
       Atapi->PrimarySecondary = 0;
-    } else if ((SctStrCmp (ParamIdentifierVal, L"Secondary") == 0) || (SctStrCmp(ParamIdentifierVal, L"1"))) {
+    } else if ((SctStrCmp (ParamIdentifierVal, L"Secondary") == 0) || (SctStrCmp(ParamIdentifierVal, L"1" == 0))) {
       Atapi->PrimarySecondary = 1;
     } else {
       goto InValidText;
@@ -1175,9 +1175,9 @@ BuildAtaDeviceNode (

   Status = GetNextRequiredParam(&TextDeviceNode, L"Drive", &ParamIdentifierStr, &ParamIdentifierVal);
   if ((!EFI_ERROR(Status)) && (ParamIdentifierVal != NULL)) {
-  	if ((SctStrCmp (ParamIdentifierVal, L"Master") == 0) || (SctStrCmp(ParamIdentifierVal, L"0"))) {
+    if ((SctStrCmp (ParamIdentifierVal, L"Master") == 0) || (SctStrCmp(ParamIdentifierVal, L"0") == 0)) {
       Atapi->SlaveMaster = 0;
-    } else if ((SctStrCmp (ParamIdentifierVal, L"Slave") == 0) || (SctStrCmp(ParamIdentifierVal, L"1"))) {
+    } else if ((SctStrCmp (ParamIdentifierVal, L"Slave") == 0) || (SctStrCmp(ParamIdentifierVal, L"1" == 0))) {
       Atapi->SlaveMaster = 1;
     } else {
       goto InValidText;
--
2.30.2


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

* Re: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: fix BuildAtaDeviceNode()
  2021-03-31 15:38 [PATCH edk2-test 1/1] uefi-sct/SctPkg: fix BuildAtaDeviceNode() Heinrich Schuchardt
@ 2021-04-05 15:45 ` G Edhaya Chandran
  0 siblings, 0 replies; 2+ messages in thread
From: G Edhaya Chandran @ 2021-04-05 15:45 UTC (permalink / raw)
  To: devel@edk2.groups.io, xypron.glpk@gmx.de
  Cc: Eric Jin, Barton Gao, Arvin Chen, Samer El-Haj-Mahmoud

Comments as below

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich
> Schuchardt via groups.io
> Sent: 31 March 2021 21:09
> To: EDK II Development <devel@edk2.groups.io>
> Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran
> <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Arvin
> Chen <arvinx.chen@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
> Subject: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: fix
> BuildAtaDeviceNode()
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3290
>
> When BuildAtaDeviceNode() is called with L"Ata(0,0,0)" it creates a node
> Ata(1,1,0). This leads to test to an assertion failed test result
>
>     ../DevicePathToTextBBTestFunction.c:332:
>     Convert result: Ata(0,0,0) - Expected: Ata(Primary,Master,0)
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  .../BlackBoxTest/DevicePathToTextBBTestMain.c             | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/Device
> PathToTextBBTestMain.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/Device
> PathToTextBBTestMain.c
> index 7cf473d30643..59f9cc71831b 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBoxTest/Device
> PathToTextBBTestMain.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackB
> +++ oxTest/DevicePathToTextBBTestMain.c
> @@ -1162,9 +1162,9 @@ BuildAtaDeviceNode (
>
>    Status = GetNextRequiredParam(&TextDeviceNode, L"Controller",
> &ParamIdentifierStr, &ParamIdentifierVal);
>    if ((!EFI_ERROR(Status)) && (ParamIdentifierVal != NULL)) {
> -  if ((SctStrCmp (ParamIdentifierVal, L"Primary") == 0) ||
> (SctStrCmp(ParamIdentifierVal, L"0"))) {
> +    if ((SctStrCmp (ParamIdentifierVal, L"Primary") == 0) ||
> + (SctStrCmp(ParamIdentifierVal, L"0" == 0))) {
>        Atapi->PrimarySecondary = 0;
> -    } else if ((SctStrCmp (ParamIdentifierVal, L"Secondary") == 0) ||
> (SctStrCmp(ParamIdentifierVal, L"1"))) {
> +    } else if ((SctStrCmp (ParamIdentifierVal, L"Secondary") == 0) ||
> + (SctStrCmp(ParamIdentifierVal, L"1" == 0))) {
 //Needs a bracket
>        Atapi->PrimarySecondary = 1;
>      } else {
>        goto InValidText;
> @@ -1175,9 +1175,9 @@ BuildAtaDeviceNode (
>
>    Status = GetNextRequiredParam(&TextDeviceNode, L"Drive",
> &ParamIdentifierStr, &ParamIdentifierVal);
>    if ((!EFI_ERROR(Status)) && (ParamIdentifierVal != NULL)) {
> -  if ((SctStrCmp (ParamIdentifierVal, L"Master") == 0) ||
> (SctStrCmp(ParamIdentifierVal, L"0"))) {
> +    if ((SctStrCmp (ParamIdentifierVal, L"Master") == 0) ||
> + (SctStrCmp(ParamIdentifierVal, L"0") == 0)) {
>        Atapi->SlaveMaster = 0;
> -    } else if ((SctStrCmp (ParamIdentifierVal, L"Slave") == 0) ||
> (SctStrCmp(ParamIdentifierVal, L"1"))) {
> +    } else if ((SctStrCmp (ParamIdentifierVal, L"Slave") == 0) ||
> + (SctStrCmp(ParamIdentifierVal, L"1" == 0))) {
//Needs a bracket
>        Atapi->SlaveMaster = 1;
>      } else {
>        goto InValidText;
> --
> 2.30.2
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#73580): https://edk2.groups.io/g/devel/message/73580
> Mute This Topic: https://groups.io/mt/81752799/4611056
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [edhaya.chandran@arm.com] -=-=-=-=-=-=
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

end of thread, other threads:[~2021-04-05 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31 15:38 [PATCH edk2-test 1/1] uefi-sct/SctPkg: fix BuildAtaDeviceNode() Heinrich Schuchardt
2021-04-05 15:45 ` [edk2-devel] " G Edhaya Chandran

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