[PATCH edk2-test v2 1/1] uefi-sct/SctPkg: fix BuildAtaDeviceNode()


Heinrich Schuchardt
 

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

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>
=2D--
v2:
correct parentheses
=2D--
.../BlackBoxTest/DevicePathToTextBBTestMain.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/B=
lackBoxTest/DevicePathToTextBBTestMain.c b/uefi-sct/SctPkg/TestCase/UEFI/E=
FI/Protocol/DevicePathToText/BlackBoxTest/DevicePathToTextBBTestMain.c
index 46b97a2d2648..183434ee1c78 100644
=2D-- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackB=
oxTest/DevicePathToTextBBTestMain.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathToText/BlackBox=
Test/DevicePathToTextBBTestMain.c
@@ -1162,9 +1162,9 @@ BuildAtaDeviceNode (

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

Status =3D GetNextRequiredParam(&TextDeviceNode, L"Drive", &ParamIdenti=
fierStr, &ParamIdentifierVal);
if ((!EFI_ERROR(Status)) && (ParamIdentifierVal !=3D NULL)) {
- if ((SctStrCmp (ParamIdentifierVal, L"Master") =3D=3D 0) || (SctStrCmp=
(ParamIdentifierVal, L"0"))) {
+ if ((SctStrCmp (ParamIdentifierVal, L"Master") =3D=3D 0) || (SctStrCm=
p(ParamIdentifierVal, L"0") =3D=3D 0)) {
Atapi->SlaveMaster =3D 0;
- } else if ((SctStrCmp (ParamIdentifierVal, L"Slave") =3D=3D 0) || (Sc=
tStrCmp(ParamIdentifierVal, L"1"))) {
+ } else if ((SctStrCmp (ParamIdentifierVal, L"Slave") =3D=3D 0) || (Sc=
tStrCmp(ParamIdentifierVal, L"1") =3D=3D 0)) {
Atapi->SlaveMaster =3D 1;
} else {
goto InValidText;
=2D-
2.30.2


G Edhaya Chandran
 

Reviewed-by: G Edhaya Chandran<edhaya.chandran@...>


G Edhaya Chandran
 

Upstreamed through commit-id : https://github.com/tianocore/edk2-test/commit/dc6efa23c099a04702854d36e518939b50aeea7f