]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UnitTestFrameworkPkg/ResultReportLib: Remove invalid index string indicator
authorGuomin Jiang <guomin.jiang@intel.com>
Thu, 26 Mar 2020 07:17:59 +0000 (15:17 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 27 Mar 2020 02:03:41 +0000 (02:03 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2535

The UNIT_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.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c

index 687a04f55dae3af2ea99e228209b56d73de02b8c..eba68e330c764f9f1063be1977505c438a3f2d7e 100644 (file)
@@ -65,7 +65,7 @@ GetStringForUnitTestStatus (
 {\r
   UINTN  Index;\r
 \r
-  for (Index = 0; Index < ARRAY_SIZE (mStatusStrings); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mStatusStrings) - 1; Index++) {\r
     if (mStatusStrings[Index].Status == Status) {\r
       //\r
       // Return string from matching entry\r
@@ -87,7 +87,7 @@ GetStringForFailureType (
 {\r
   UINTN  Index;\r
 \r
-  for (Index = 0; Index < ARRAY_SIZE (mFailureTypeStrings); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mFailureTypeStrings) - 1; Index++) {\r
     if (mFailureTypeStrings[Index].Type == Failure) {\r
       //\r
       // Return string from matching entry\r