From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.47037.1584942964979748815 for ; Sun, 22 Mar 2020 22:56:05 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: guomin.jiang@intel.com) IronPort-SDR: 5d6JpUhaos8+u4HuQqmYa+OLm+AUp12Q+mxHYG2rY88tCtUrsFOSmAUODXaH+iGUIMO2VMZrlC 4xj8K7GF0qQQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 22:56:04 -0700 IronPort-SDR: HeoPD04arIsodMBUMC7I9EzAvQoPhvjST5SSZhHOPWLcO4+64iTRiuKXIu7Cyhq0bdyULMEXhL OJoEY1OgL8kQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,295,1580803200"; d="scan'208";a="356998477" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 22 Mar 2020 22:56:04 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Mar 2020 22:56:04 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Mar 2020 22:56:03 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.43]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.96]) with mapi id 14.03.0439.000; Mon, 23 Mar 2020 13:56:01 +0800 From: "Guomin Jiang" To: "devel@edk2.groups.io" , "Zhang, Shenglei" , "newexplorerj@gmail.com" CC: "Kinney, Michael D" , "sean.brogan@microsoft.com" , "Bret.Barkelew@microsoft.com" Subject: Re: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index may be used. Thread-Topic: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index may be used. Thread-Index: AQHV549QR3bmRjtKJE2D0XEx/xKdUqg4Jm8AgB25P+A= Date: Mon, 23 Mar 2020 05:56:01 +0000 Message-ID: References: <02ae08887ff10e981ee247a74ce2e89eb1a4d747.1582162590.git.newexplorerj@gmail.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: guomin.jiang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Michael, Sean, Bret, Could help review the patch? Thanks > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Zhang, Shenglei > Sent: Wednesday, March 4, 2020 3:59 PM > To: devel@edk2.groups.io; newexplorerj@gmail.com > Subject: Re: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index ma= y > be used. >=20 > Reviewed-by: Shenglei Zhang >=20 > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > GuoMinJ > > Sent: Thursday, February 20, 2020 9:42 AM > > To: devel@edk2.groups.io > > Cc: GuoMinJ > > Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index may > > be used. > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2535 > > > > The UINT_TEST_STATUS and FAILURE_TYPE have used 0 as status, so use 0 > > as unknown is confused, remove it from array enumeration but keep it > > location in the array. > > > > Signed-off-by: GuoMinJ > > --- > > .../Library/UnitTestResultReportLib/UnitTestResultReportLib.c | 4 > > ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > > > a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > > eportLib.c > > > b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > > eportLib.c > > index 687a04f55d..eba68e330c 100644 > > --- > > > a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > > eportLib.c > > +++ > > > b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > > eportLib.c > > @@ -65,7 +65,7 @@ GetStringForUnitTestStatus ( { > > UINTN Index; > > > > - for (Index =3D 0; Index < ARRAY_SIZE (mStatusStrings); Index++) { > > + for (Index =3D 0; Index < ARRAY_SIZE (mStatusStrings) - 1; Index++)= { > > if (mStatusStrings[Index].Status =3D=3D Status) { > > // > > // Return string from matching entry @@ -87,7 +87,7 @@ > > GetStringForFailureType ( { > > UINTN Index; > > > > - for (Index =3D 0; Index < ARRAY_SIZE (mFailureTypeStrings); Index++= ) > > { > > + for (Index =3D 0; Index < ARRAY_SIZE (mFailureTypeStrings) - 1; > > + Index++) { > > if (mFailureTypeStrings[Index].Type =3D=3D Failure) { > > // > > // Return string from matching entry > > -- > > 2.17.1 > > > > > > >=20 >=20 >=20