From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=eric.jin@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 641F221167463 for ; Thu, 11 Oct 2018 18:53:21 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 18:53:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,370,1534834800"; d="scan'208";a="271713755" Received: from shwdeopenpsi175.ccr.corp.intel.com ([10.239.9.140]) by fmsmga006.fm.intel.com with ESMTP; 11 Oct 2018 18:53:19 -0700 From: Eric Jin To: edk2-devel@lists.01.org Cc: Supreeth Venkatesh , Jiaxin Wu Date: Fri, 12 Oct 2018 09:52:56 +0800 Message-Id: <20181012015256.232-1-eric.jin@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [edk2-test][Patch] uefi-sct\SctPkg: Add checkpoint of LocateProtocol() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 01:53:21 -0000 Clarify return value for NULL pointer in LocateProtocol() API When input parameter Protocol is NULL, EFI_INVALID_PARAMETER should be returned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Jin Cc: Supreeth Venkatesh Cc: Jiaxin Wu --- .../ProtocolHandlerServices/BlackBoxTest/Guid.c | 8 +++---- .../ProtocolHandlerServices/BlackBoxTest/Guid.h | 12 ++++------ .../ProtocolHandlerBBTestConformance.c | 27 +++++++++++++++++++++- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c index 4069d2f..40927f7 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -44,7 +44,7 @@ EFI_GUID gConsistencyTestAssertionGuid007 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0 EFI_GUID gConsistencyTestAssertionGuid008 = EFI_TEST_CONSISTENCYTEST_ASSERTION_008_GUID; -//EFI_GUID gConsistencyTestAssertionGuid009 = EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID; +EFI_GUID gConsistencyTestAssertionGuid009 = EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID; EFI_GUID gConsistencyTestAssertionGuid010 = EFI_TEST_CONSISTENCYTEST_ASSERTION_010_GUID; @@ -70,7 +70,7 @@ EFI_GUID gConsistencyTestAssertionGuid020 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0 EFI_GUID gConsistencyTestAssertionGuid021 = EFI_TEST_CONSISTENCYTEST_ASSERTION_021_GUID; -EFI_GUID gConsistencyTestAssertionGuid022 = EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID; +//EFI_GUID gConsistencyTestAssertionGuid022 = EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID; EFI_GUID gConsistencyTestAssertionGuid023 = EFI_TEST_CONSISTENCYTEST_ASSERTION_023_GUID; @@ -140,7 +140,7 @@ EFI_GUID gConsistencyTestAssertionGuid055 = EFI_TEST_CONSISTENCYTEST_ASSERTION_0 EFI_GUID gConsistencyTestAssertionGuid056 = EFI_TEST_CONSISTENCYTEST_ASSERTION_056_GUID; -EFI_GUID gConsistencyTestAssertionGuid057 = EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID; +//EFI_GUID gConsistencyTestAssertionGuid057 = EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID; EFI_GUID gConsistencyTestAssertionGuid058 = EFI_TEST_CONSISTENCYTEST_ASSERTION_058_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h index 06fbc80..d42d968 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/Guid.h @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -65,12 +65,10 @@ extern EFI_GUID gConsistencyTestAssertionGuid007; extern EFI_GUID gConsistencyTestAssertionGuid008; -/* #define EFI_TEST_CONSISTENCYTEST_ASSERTION_009_GUID \ { 0xe9712c64, 0x302e, 0x4984, {0x9e, 0xc2, 0xb9, 0x91, 0xd3, 0x5e, 0x2e, 0x11 }} extern EFI_GUID gConsistencyTestAssertionGuid009; -*/ #define EFI_TEST_CONSISTENCYTEST_ASSERTION_010_GUID \ { 0xf7c8a812, 0x97c8, 0x4283, {0xa7, 0x79, 0x9c, 0x3a, 0x0d, 0xf9, 0x9b, 0x44 }} @@ -131,12 +129,12 @@ extern EFI_GUID gConsistencyTestAssertionGuid020; { 0x0df6b782, 0xbb9c, 0x40e1, {0x99, 0x31, 0xfa, 0x07, 0xce, 0x4e, 0xf3, 0x2d }} extern EFI_GUID gConsistencyTestAssertionGuid021; - +/* #define EFI_TEST_CONSISTENCYTEST_ASSERTION_022_GUID \ { 0x8508de3d, 0x795d, 0x4833, {0x8c, 0xe2, 0x3c, 0xf9, 0x60, 0x05, 0x50, 0x5b }} extern EFI_GUID gConsistencyTestAssertionGuid022; - +*/ #define EFI_TEST_CONSISTENCYTEST_ASSERTION_023_GUID \ { 0x6cad11b3, 0x9ea5, 0x4d60, {0xb0, 0x6c, 0xaf, 0xf3, 0xfd, 0xef, 0x90, 0x8d }} @@ -306,12 +304,12 @@ extern EFI_GUID gConsistencyTestAssertionGuid055; { 0x357d40b9, 0xa9b0, 0x4462, {0xa4, 0xc7, 0x40, 0xca, 0x18, 0xcb, 0x17, 0x34 }} extern EFI_GUID gConsistencyTestAssertionGuid056; - +/* #define EFI_TEST_CONSISTENCYTEST_ASSERTION_057_GUID \ { 0xf4f96d88, 0x1924, 0x4d35, {0x94, 0xc9, 0x7f, 0x7b, 0x6e, 0x42, 0xc2, 0xd4 }} extern EFI_GUID gConsistencyTestAssertionGuid057; - +*/ #define EFI_TEST_CONSISTENCYTEST_ASSERTION_058_GUID \ { 0x4f733e46, 0xdacb, 0x4f6f, {0x80, 0x2b, 0x05, 0x45, 0x00, 0x3a, 0x6a, 0x64 }} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c index 98ce893..ec3637d 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/ProtocolHandlerServices/BlackBoxTest/ProtocolHandlerBBTestConformance.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -2487,6 +2487,31 @@ BBTestLocateProtocolConsistencyTest ( ); // + // Add a checkpoint from the 1559 + // If Protocol is NULL, then EFI_INVALID_PARAMETER is returned + // + Status = gtBS->LocateProtocol ( + NULL, + NULL, + (VOID **) &TestProtocol2 + ); + if (Status == EFI_INVALID_PARAMETER) { + AssertionType = EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType = EFI_TEST_ASSERTION_FAILED; + } + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gConsistencyTestAssertionGuid009, + L"BS.LocateProtocol - ConsistencyTestCheckpoint4", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // // Checkpoint 2: // 3.10.2.2 LocateProtocol should not succeed // with a protocol GUID that was never installed -- 2.9.0.windows.1