From 381f8ef6a176b41c350a7c50da403c30da70cde7 Mon Sep 17 00:00:00 2001 From: Guomin Jiang Date: Thu, 26 Mar 2020 15:17:59 +0800 Subject: UnitTestFrameworkPkg/ResultReportLib: Remove invalid index string indicator 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 Cc: Sean Brogan Cc: Bret Barkelew Signed-off-by: Guomin Jiang Reviewed-by: Shenglei Zhang Reviewed-by: Michael D Kinney Reviewed-by: Bret Barkelew --- .../Library/UnitTestResultReportLib/UnitTestResultReportLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'UnitTestFrameworkPkg') diff --git a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c index 687a04f55d..eba68e330c 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c @@ -65,7 +65,7 @@ GetStringForUnitTestStatus ( { UINTN Index; - for (Index = 0; Index < ARRAY_SIZE (mStatusStrings); Index++) { + for (Index = 0; Index < ARRAY_SIZE (mStatusStrings) - 1; Index++) { if (mStatusStrings[Index].Status == Status) { // // Return string from matching entry @@ -87,7 +87,7 @@ GetStringForFailureType ( { UINTN Index; - for (Index = 0; Index < ARRAY_SIZE (mFailureTypeStrings); Index++) { + for (Index = 0; Index < ARRAY_SIZE (mFailureTypeStrings) - 1; Index++) { if (mFailureTypeStrings[Index].Type == Failure) { // // Return string from matching entry -- cgit v1.2.3