From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A77C77803CC for ; Thu, 17 Aug 2023 02:41:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VpcNNNfHun5S9HZenDGMlOpqNgJ3F20JtQSY15FkIxM=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1692240082; v=1; b=vBIjUY2/u4sZKqZWF0MgJVW11d5/BiEZ7Mvd/GOSy61aDWdsnqlcOfglCvwFspyiGJLdLn4h Ktw0lDhp0aOEJOFz1Ag/yp2LwydOKJXtQLagxMSJHW4C4NC6DV3dBBqaJUxzn9U0eJVwxCHjrYN MN+D8uKfHCe6QXjtlwFj7GCo= X-Received: by 127.0.0.2 with SMTP id NpBoYY7687511xmV6U16KQFv; Wed, 16 Aug 2023 19:41:22 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.178548.1692240081191009278 for ; Wed, 16 Aug 2023 19:41:21 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="403674636" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="403674636" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2023 19:41:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="763861813" X-IronPort-AV: E=Sophos;i="6.01,178,1684825200"; d="scan'208";a="763861813" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 16 Aug 2023 19:41:20 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 16 Aug 2023 19:41:19 -0700 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 16 Aug 2023 19:41:19 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 16 Aug 2023 19:41:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A1c50Uzw5eajksQN9Wk4HHFMJ9lt0yjyrsMI/aXeFF68Pa26pRahnZN5WAzZUwNROvNaDj+iBH1YAeORnA+VgJJW+RFGAPbVDKv8ldskvaZhk0hBb06b0dvzgKJfQp6HufHBwDedQrSvcSwgBfXMw72P+zdXOSNxqcQomL5cVzODXLUwKxBDYnd5D4g6CKB5JhWW2GbkE9/lwlqPwC867UaQUZn8r6cBS7RkqSbERcXmjxbgSMqYPT4sJbM9/Zg5w0oRurL4FwdIwnmKKKFllaNR38SWwJaZiYTw3d7ZZggyOFMbH8IMRuYhfnAlwIGsGn5PhbYW1OX8axRnwolsKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nWmQCUnTRAbguEEDUjDvY6/qBXZFqWEqVjwmE6qvU3k=; b=EDrmHMFX5YrtW5BvTlqtNvAoen48OEGrHfLB9zh/+1HrJp/hQFfFj3qmCNn87GIaSdy/U1NM40AAQRic+LcxLQGgSG2Hr0G1/VAwcpJPXLZy9IaxGmIfm8IFNiQvkkRkuU1QUdXpiylIyE3U8xVs2zRsowbpZmhOtBkm9RbhBjPyhOwj9lCh7l5ujcEz0lBiyWDVA1uaEWzjx8tr2/i4ZyvLhKTYjbtaIjIjWoPVmuyymhq7oKSRw/6Rgrt5y1mQN0wjyslPeOjW6nHTOfRAaJJK+KLxJhvQyGq5RGEGxXaF1w4xzTzKmmzeQTt2DcKFq/9BZVEH9b5jUeT0ttKUVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by PH0PR11MB4887.namprd11.prod.outlook.com (2603:10b6:510:30::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Thu, 17 Aug 2023 02:41:12 +0000 X-Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::fdf8:dc0e:db69:f35b]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::fdf8:dc0e:db69:f35b%4]) with mapi id 15.20.6678.029; Thu, 17 Aug 2023 02:41:12 +0000 From: "Yao, Jiewen" To: VivianNK , "devel@edk2.groups.io" CC: "Wang, Jian J" Subject: Re: [edk2-devel] [PATCH v2 5/7] SecurityPkg: Apply uncrustify formatting to relevant files Thread-Topic: [PATCH v2 5/7] SecurityPkg: Apply uncrustify formatting to relevant files Thread-Index: AQHZ0IbU2RCUj4As7UeeF9urtdhq4K/tx3KA Date: Thu, 17 Aug 2023 02:41:12 +0000 Message-ID: References: <20230816211523.12-1-vnowkakeane@linux.microsoft.com> <20230816211523.12-6-vnowkakeane@linux.microsoft.com> In-Reply-To: <20230816211523.12-6-vnowkakeane@linux.microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|PH0PR11MB4887:EE_ x-ms-office365-filtering-correlation-id: 6cb12522-e775-48bb-0223-08db9ecb6bbd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: kLgloMTBw/ayM75x/qsERbyHIBM8GbU7x+IbVvilGh+56wkdQizad2ASHuAit/ajlP4676y0Quykw99Exy1zQWzfQE8MzJtuzng2qhhLzhUppiCWNA0wSQS+Tj/TwFpsRhpvEnjO2122Q/7E/2eos5lTbfYU6L2zsdvh9fyVQlwQK7pn9X8UBCnxXbOqEJCHTr0IAO1kLQRwa/f/SdiQOFVZUa1OFdjfkSwPnPNKOdgrUI5hqNGImBwbaY4nbHengsXPYzCqSWLXb81RjxjLZOcCdgyGTffyOYOk3oyJ6gQ5lbJWXUTeNpgKXC04BsnltwJk3FM0+W2DZYqCFiwzy32FC+X9nKiIM0FUhnKpzTvWv9Sasxv8bx+uMPv7fia3W4rquvTuFDoVg6+YM94ELS361DvY2cDzuM893PlIGWANrIZdsO9J/shflIedMz8l9f5CAXaiC9wMzbgCuTjEDB3if57GZrDGGCJ4DmCAqQ+CbxxYU8Vz+wFDUZPdyXWyN6M1T21RUZD8CT1ArgCL7LCEFCqU4DLxh0V+4IYRx52YY4rxcYyJb2Jp4+BDYxgSp8tWfd8LZ4MjEa3k/CHe7HRYgjEZP4kaQtdTZLyDYTN2U5hnWhyWyO41N1kgQ7eq x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wrPbh5stGNuTxUZXFHhBJ35CZ6JQqsIznFc4GerOf+CGdB5Nv+PYHzSFghap?= =?us-ascii?Q?zbWxK046rnnZ++uzn/8FigS2ggh9CGHljkVUFRZYN1Eq1kr6ujOBYNfpxk6w?= =?us-ascii?Q?FuvwQ0cPrSHsh9Hm4P53sHBgmF9YEghynWePNVVzLqLnyEnfPN1EffQtQV3C?= =?us-ascii?Q?AG2NXVBCD7JtF2f08VN3pyotpLpVLUTtoVU3q1P6rE5X4mRG+Ga4pcHaFcW4?= =?us-ascii?Q?qrsgf00v7SDUq1paPrKT9barBBhNhVvRSlneKORZKRzh3Ehr+6DhGg0KUKxc?= =?us-ascii?Q?KP3iCzkueJLvj6uQZLPCHM4+j+N75B5YGzJZRyAf9yRjUtP/h1rBppuqBQl8?= =?us-ascii?Q?vYoSP/vzvN5hdDxEKnfwWbvHETHjkou6jfMRa6b4piOv17GPpsSH4gEctqp3?= =?us-ascii?Q?RiAXDfA7zZeX47FkkdsK7TbuDOjOjyC0YKGDZkrbMNhBRR3+f39EoL4RRGFb?= =?us-ascii?Q?3hB43nwkKxKee48YhyHBcIsUhRyx+iHDZMcGCGBF3QfHzW7HkD/V6FLIVdKx?= =?us-ascii?Q?1/5knPOSbYU5GqRiShf+ho6JCGmR2aibf5+pXpxibayhQXRk9pjeEYga2ByN?= =?us-ascii?Q?bH6n30I/od+ZObn4nxhbGISPKAJ7k2gdSsuT9ysf9cj9JNGGl7FCaOlwA0yE?= =?us-ascii?Q?BvE8jS6UIscko32k2zs5EkY+TPqAMB12pqS9QcTf4U1SUrEh0E6+W8lFL0na?= =?us-ascii?Q?QAncpMbq7nKsoFUkgD0VLbUn9cnu1rURSuXRC912Z9Ccu5IHzrPuQzkPyiF+?= =?us-ascii?Q?CIDG+qmoAuD733fQyGHp2PMkoS3bG9BHS631YPMz4EAkwTjkQd7tywoY+c90?= =?us-ascii?Q?3cbXvCBjK8iU+qk+ZJSo71bfEzBd6ap5lO+8pBpdTSqsgyqVXp8eDznD4ODD?= =?us-ascii?Q?DhJHx70/KehqKepYXWXfz6hr7xzSV9SmIflQQ19qjQRN+NJBVvSv54uLQfpw?= =?us-ascii?Q?eQmJ7V3U0rkN65Mbm/OylRIZ7n7tFClwQJPWy8Gl4JJLvUujZhxw966aQOXW?= =?us-ascii?Q?RruNg4BmZyfmhSSJvsSe/6ldlOgyYk403YLtV1d+bd6u36MpGpn9XMq/LxHh?= =?us-ascii?Q?2P0jKhUEtyf50Liwnn1AhFk4Rm7DelsJbgeH6LcrTpjkHzjL7snmDvswLQPs?= =?us-ascii?Q?T4f2MS9SpMKJRr5bjgH8uMVvb4pxjFC3vTvmgC1XG7Na5YYvSJTYWy0D4iJZ?= =?us-ascii?Q?8/hZUn2/CTk/poxY22XBdV1S3V4yoV0MFtUQxcGYECGlDfpM/CsK3UuGRlFx?= =?us-ascii?Q?sTiLj7JXc/U+jUCnXanHJpWWAfCTRkCM1UClY3NbVWxGZxqpFoXhpk/DfhZB?= =?us-ascii?Q?Y7XelsHRWSTrqZEUUAlO9OD5O+NEGDoAT/9AP3m4/OkJEeuXFFFz+mte6G1y?= =?us-ascii?Q?EjumaNPXPqOuqfSDsuA5YwMtnVpMcgugvnrhu5Q2UgHr0NOqFXLYsSRs4v4M?= =?us-ascii?Q?0P8Mo2A16FEcCAcvibrmQSCD29qUpoZk6dsSBRyqyZ9f7ZNjBsgwc/OYNWEs?= =?us-ascii?Q?5wcaYyHV/vQnSGFPjy4MAvQmMwfGg46HH6k7VxpuL/zZCdPWEfpqulnoHr7G?= =?us-ascii?Q?JQ/DfD0565TiL4lpduZAlbcFcxlpM8mr02TrrEFO?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cb12522-e775-48bb-0223-08db9ecb6bbd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Aug 2023 02:41:12.5616 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dWvhbTJ0j8qjQLe+Pzg1tDBHFxi4veLBR31R8sOx/8nlgLDK31xkE9B7cjoiy+876ivXLY/oseEaRAjSgRW2YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4887 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jiewen.yao@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: zhtzgibcZ8YSXgmWv35bVr1Jx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="vBIjUY2/"; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Jiewen Yao > -----Original Message----- > From: VivianNK > Sent: Thursday, August 17, 2023 5:15 AM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J > Subject: [PATCH v2 5/7] SecurityPkg: Apply uncrustify formatting to relev= ant files >=20 > Apply uncrustify formatting to GoogleTest cpp and header files. >=20 >=20 > Cc: Jiewen Yao > Cc: Jian J Wang > Signed-off-by: Vivian Nowka-Keane > --- >=20 > SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariableLi= bGo > ogleTest.cpp | 205 ++++++++++++-------- >=20 > SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtection= Li > b.h | 4 +- >=20 > SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/Mock= P > latformPKProtectionLib.cpp | 4 +- > 3 files changed, 124 insertions(+), 89 deletions(-) >=20 > diff --git > a/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariable= Lib > GoogleTest.cpp > b/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariable= Lib > GoogleTest.cpp > index c9190c8ffd61..f66c595a97a8 100644 > --- > a/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariable= Lib > GoogleTest.cpp > +++ > b/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariable= Lib > GoogleTest.cpp > @@ -21,154 +21,189 @@ using namespace testing; >=20 >=20 > ////////////////////////////////////////////////////////////////////////= ////// >=20 > class SetSecureBootModeTest : public Test { >=20 > - protected: >=20 > - MockUefiRuntimeServicesTableLib RtServicesMock; >=20 > - UINT8 SecureBootMode; >=20 > - EFI_STATUS Status; >=20 > +protected: >=20 > + MockUefiRuntimeServicesTableLib RtServicesMock; >=20 > + UINT8 SecureBootMode; >=20 > + EFI_STATUS Status; >=20 >=20 >=20 > - void SetUp() override { >=20 > - // Any random magic number can be used for these tests >=20 > - SecureBootMode =3D 0xAB; >=20 > - } >=20 > + void >=20 > + SetUp ( >=20 > + ) override >=20 > + { >=20 > + // Any random magic number can be used for these tests >=20 > + SecureBootMode =3D 0xAB; >=20 > + } >=20 > }; >=20 >=20 >=20 > // Test SetSecureBootMode() API from SecureBootVariableLib to verify the >=20 > // expected error is returned when the call to gRT->SetVariable() fails. >=20 > -TEST_F(SetSecureBootModeTest, SetVarError) { >=20 > - EXPECT_CALL(RtServicesMock, gRT_SetVariable) >=20 > - .WillOnce(Return(EFI_INVALID_PARAMETER)); >=20 > +TEST_F (SetSecureBootModeTest, SetVarError) { >=20 > + EXPECT_CALL (RtServicesMock, gRT_SetVariable) >=20 > + .WillOnce (Return (EFI_INVALID_PARAMETER)); >=20 >=20 >=20 > - Status =3D SetSecureBootMode(SecureBootMode); >=20 > - EXPECT_EQ(Status, EFI_INVALID_PARAMETER); >=20 > + Status =3D SetSecureBootMode (SecureBootMode); >=20 > + EXPECT_EQ (Status, EFI_INVALID_PARAMETER); >=20 > } >=20 >=20 >=20 > // Test SetSecureBootMode() API from SecureBootVariableLib to verify the >=20 > // expected secure boot mode is written to the correct variable in the c= all >=20 > // to gRT->SetVariable(). >=20 > -TEST_F(SetSecureBootModeTest, PropogateModeToSetVar) { >=20 > - EXPECT_CALL(RtServicesMock, >=20 > - gRT_SetVariable( >=20 > - Char16StrEq(EFI_CUSTOM_MODE_NAME), >=20 > - BufferEq(&gEfiCustomModeEnableGuid, sizeof(EFI_GUID)), >=20 > +TEST_F (SetSecureBootModeTest, PropogateModeToSetVar) { >=20 > + EXPECT_CALL ( >=20 > + RtServicesMock, >=20 > + gRT_SetVariable ( >=20 > + Char16StrEq (EFI_CUSTOM_MODE_NAME), >=20 > + BufferEq (&gEfiCustomModeEnableGuid, sizeof (EFI_GUID)), >=20 > EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, >=20 > - sizeof(SecureBootMode), >=20 > - BufferEq(&SecureBootMode, sizeof(SecureBootMode)))) >=20 > - .WillOnce(Return(EFI_SUCCESS)); >=20 > + sizeof (SecureBootMode), >=20 > + BufferEq (&SecureBootMode, sizeof (SecureBootMode)) >=20 > + ) >=20 > + ) >=20 > + .WillOnce (Return (EFI_SUCCESS)); >=20 >=20 >=20 > - Status =3D SetSecureBootMode(SecureBootMode); >=20 > - EXPECT_EQ(Status, EFI_SUCCESS); >=20 > + Status =3D SetSecureBootMode (SecureBootMode); >=20 > + EXPECT_EQ (Status, EFI_SUCCESS); >=20 > } >=20 >=20 >=20 > ////////////////////////////////////////////////////////////////////////= ////// >=20 > class GetSetupModeTest : public Test { >=20 > - protected: >=20 > - MockUefiRuntimeServicesTableLib RtServicesMock; >=20 > - UINT8 SetupMode; >=20 > - EFI_STATUS Status; >=20 > - UINT8 ExpSetupMode; >=20 > +protected: >=20 > + MockUefiRuntimeServicesTableLib RtServicesMock; >=20 > + UINT8 SetupMode; >=20 > + EFI_STATUS Status; >=20 > + UINT8 ExpSetupMode; >=20 >=20 >=20 > - void SetUp() override { >=20 > - // Any random magic number can be used for these tests >=20 > - ExpSetupMode =3D 0xAB; >=20 > - } >=20 > + void >=20 > + SetUp ( >=20 > + ) override >=20 > + { >=20 > + // Any random magic number can be used for these tests >=20 > + ExpSetupMode =3D 0xAB; >=20 > + } >=20 > }; >=20 >=20 >=20 > // Test GetSetupMode() API from SecureBootVariableLib to verify the expe= cted >=20 > // error is returned when the call to gRT->GetVariable() fails. >=20 > -TEST_F(GetSetupModeTest, GetVarError) { >=20 > - EXPECT_CALL(RtServicesMock, gRT_GetVariable) >=20 > - .WillOnce(Return(EFI_INVALID_PARAMETER)); >=20 > +TEST_F (GetSetupModeTest, GetVarError) { >=20 > + EXPECT_CALL (RtServicesMock, gRT_GetVariable) >=20 > + .WillOnce (Return (EFI_INVALID_PARAMETER)); >=20 >=20 >=20 > Status =3D GetSetupMode (&SetupMode); >=20 > - EXPECT_EQ(Status, EFI_INVALID_PARAMETER); >=20 > + EXPECT_EQ (Status, EFI_INVALID_PARAMETER); >=20 > } >=20 >=20 >=20 > // Test GetSetupMode() API from SecureBootVariableLib to verify the expe= cted >=20 > // setup mode is returned (and with a success return code) when the mode= is >=20 > // successfully read from the call to gRT->GetVariable(). >=20 > -TEST_F(GetSetupModeTest, FetchModeFromGetVar) { >=20 > - EXPECT_CALL(RtServicesMock, >=20 > - gRT_GetVariable( >=20 > - Char16StrEq(EFI_SETUP_MODE_NAME), >=20 > - BufferEq(&gEfiGlobalVariableGuid, sizeof(EFI_GUID)), >=20 > +TEST_F (GetSetupModeTest, FetchModeFromGetVar) { >=20 > + EXPECT_CALL ( >=20 > + RtServicesMock, >=20 > + gRT_GetVariable ( >=20 > + Char16StrEq (EFI_SETUP_MODE_NAME), >=20 > + BufferEq (&gEfiGlobalVariableGuid, sizeof (EFI_GUID)), >=20 > _, >=20 > - Pointee(Eq(sizeof(SetupMode))), >=20 > - NotNull())) >=20 > - .WillOnce(DoAll( >=20 > - SetArgPointee<3>(sizeof(ExpSetupMode)), >=20 > - SetArgBuffer<4>(&ExpSetupMode, sizeof(ExpSetupMode)), >=20 > - Return(EFI_SUCCESS))); >=20 > + Pointee (Eq (sizeof (SetupMode))), >=20 > + NotNull () >=20 > + ) >=20 > + ) >=20 > + .WillOnce ( >=20 > + DoAll ( >=20 > + SetArgPointee<3>(sizeof (ExpSetupMode)), >=20 > + SetArgBuffer<4>(&ExpSetupMode, sizeof (ExpSetupMode)), >=20 > + Return (EFI_SUCCESS) >=20 > + ) >=20 > + ); >=20 >=20 >=20 > Status =3D GetSetupMode (&SetupMode); >=20 > - ASSERT_EQ(Status, EFI_SUCCESS); >=20 > - EXPECT_EQ(SetupMode, ExpSetupMode); >=20 > + ASSERT_EQ (Status, EFI_SUCCESS); >=20 > + EXPECT_EQ (SetupMode, ExpSetupMode); >=20 > } >=20 >=20 >=20 > ////////////////////////////////////////////////////////////////////////= ////// >=20 > class IsSecureBootEnabledTest : public Test { >=20 > - protected: >=20 > - MockUefiLib UefiLibMock; >=20 > - BOOLEAN Enabled; >=20 > +protected: >=20 > + MockUefiLib UefiLibMock; >=20 > + BOOLEAN Enabled; >=20 > }; >=20 >=20 >=20 > // Test IsSecureBootEnabled() API from SecureBootVariableLib to verify F= ALSE >=20 > // is returned when the call to GetEfiGlobalVariable2() fails. >=20 > -TEST_F(IsSecureBootEnabledTest, GetVarError) { >=20 > - EXPECT_CALL(UefiLibMock, GetEfiGlobalVariable2) >=20 > - .WillOnce(Return(EFI_ABORTED)); >=20 > +TEST_F (IsSecureBootEnabledTest, GetVarError) { >=20 > + EXPECT_CALL (UefiLibMock, GetEfiGlobalVariable2) >=20 > + .WillOnce (Return (EFI_ABORTED)); >=20 >=20 >=20 > Enabled =3D IsSecureBootEnabled (); >=20 > - EXPECT_EQ(Enabled, FALSE); >=20 > + EXPECT_EQ (Enabled, FALSE); >=20 > } >=20 >=20 >=20 > ////////////////////////////////////////////////////////////////////////= ////// >=20 > class IsSecureBootEnabledAllocTest : public IsSecureBootEnabledTest { >=20 > - protected: >=20 > - UINT8 *BootEnabledBuffer; >=20 > +protected: >=20 > + UINT8 *BootEnabledBuffer; >=20 >=20 >=20 > - void SetUp() override { >=20 > - BootEnabledBuffer =3D (UINT8*) AllocatePool(1); >=20 > - ASSERT_NE(BootEnabledBuffer, nullptr); >=20 > - } >=20 > + void >=20 > + SetUp ( >=20 > + ) override >=20 > + { >=20 > + BootEnabledBuffer =3D (UINT8 *)AllocatePool (1); >=20 > + ASSERT_NE (BootEnabledBuffer, nullptr); >=20 > + } >=20 > }; >=20 >=20 >=20 > // Test IsSecureBootEnabled() API from SecureBootVariableLib to verify T= RUE >=20 > // is returned when the call to GetEfiGlobalVariable2() is successful an= d >=20 > // returns SECURE_BOOT_MODE_ENABLE. >=20 > -TEST_F(IsSecureBootEnabledAllocTest, IsEnabled) { >=20 > +TEST_F (IsSecureBootEnabledAllocTest, IsEnabled) { >=20 > *BootEnabledBuffer =3D SECURE_BOOT_MODE_ENABLE; >=20 > - EXPECT_CALL(UefiLibMock, >=20 > - GetEfiGlobalVariable2( >=20 > - Char16StrEq(EFI_SECURE_BOOT_MODE_NAME), >=20 > - NotNull(), >=20 > - _)) >=20 > - .WillOnce(DoAll( >=20 > - SetArgBuffer<1>(&BootEnabledBuffer, sizeof(VOID*)), >=20 > - Return(EFI_SUCCESS))); >=20 > + EXPECT_CALL ( >=20 > + UefiLibMock, >=20 > + GetEfiGlobalVariable2 ( >=20 > + Char16StrEq (EFI_SECURE_BOOT_MODE_NAME), >=20 > + NotNull (), >=20 > + _ >=20 > + ) >=20 > + ) >=20 > + .WillOnce ( >=20 > + DoAll ( >=20 > + SetArgBuffer<1>(&BootEnabledBuffer, sizeof (VOID *)), >=20 > + Return (EFI_SUCCESS) >=20 > + ) >=20 > + ); >=20 >=20 >=20 > Enabled =3D IsSecureBootEnabled (); >=20 > - EXPECT_EQ(Enabled, TRUE); >=20 > + EXPECT_EQ (Enabled, TRUE); >=20 > } >=20 >=20 >=20 > // Test IsSecureBootEnabled() API from SecureBootVariableLib to verify F= ALSE >=20 > // is returned when the call to GetEfiGlobalVariable2() is successful an= d >=20 > // returns SECURE_BOOT_MODE_DISABLE. >=20 > -TEST_F(IsSecureBootEnabledAllocTest, IsDisabled) { >=20 > +TEST_F (IsSecureBootEnabledAllocTest, IsDisabled) { >=20 > *BootEnabledBuffer =3D SECURE_BOOT_MODE_DISABLE; >=20 > - EXPECT_CALL(UefiLibMock, >=20 > - GetEfiGlobalVariable2( >=20 > - Char16StrEq(EFI_SECURE_BOOT_MODE_NAME), >=20 > - NotNull(), >=20 > - _)) >=20 > - .WillOnce(DoAll( >=20 > - SetArgBuffer<1>(&BootEnabledBuffer, sizeof(VOID*)), >=20 > - Return(EFI_SUCCESS))); >=20 > + EXPECT_CALL ( >=20 > + UefiLibMock, >=20 > + GetEfiGlobalVariable2 ( >=20 > + Char16StrEq (EFI_SECURE_BOOT_MODE_NAME), >=20 > + NotNull (), >=20 > + _ >=20 > + ) >=20 > + ) >=20 > + .WillOnce ( >=20 > + DoAll ( >=20 > + SetArgBuffer<1>(&BootEnabledBuffer, sizeof (VOID *)), >=20 > + Return (EFI_SUCCESS) >=20 > + ) >=20 > + ); >=20 >=20 >=20 > Enabled =3D IsSecureBootEnabled (); >=20 > - EXPECT_EQ(Enabled, FALSE); >=20 > + EXPECT_EQ (Enabled, FALSE); >=20 > } >=20 >=20 >=20 > -int main(int argc, char* argv[]) { >=20 > - testing::InitGoogleTest(&argc, argv); >=20 > - return RUN_ALL_TESTS(); >=20 > +int >=20 > +main ( >=20 > + int argc, >=20 > + char *argv[] >=20 > + ) >=20 > +{ >=20 > + testing::InitGoogleTest (&argc, argv); >=20 > + return RUN_ALL_TESTS (); >=20 > } >=20 > diff --git > a/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtecti= on > Lib.h > b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtecti= on > Lib.h > index 8024f4be2975..04288f2b75a3 100644 > --- > a/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtecti= on > Lib.h > +++ > b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtecti= on > Lib.h > @@ -11,8 +11,8 @@ > #include >=20 > #include >=20 > extern "C" { >=20 > -#include >=20 > -#include >=20 > + #include >=20 > + #include >=20 > } >=20 >=20 >=20 > struct MockPlatformPKProtectionLib { >=20 > diff --git > a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/Mo= c > kPlatformPKProtectionLib.cpp > b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/Mo= c > kPlatformPKProtectionLib.cpp > index 5ea030f6dfcf..6613d5ed199a 100644 > --- > a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/Mo= c > kPlatformPKProtectionLib.cpp > +++ > b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/Mo= c > kPlatformPKProtectionLib.cpp > @@ -6,6 +6,6 @@ > **/ >=20 > #include >=20 >=20 >=20 > -MOCK_INTERFACE_DEFINITION(MockPlatformPKProtectionLib); >=20 > +MOCK_INTERFACE_DEFINITION (MockPlatformPKProtectionLib); >=20 >=20 >=20 > -MOCK_FUNCTION_DEFINITION(MockPlatformPKProtectionLib, > DisablePKProtection, 0, EFIAPI); >=20 > +MOCK_FUNCTION_DEFINITION (MockPlatformPKProtectionLib, > DisablePKProtection, 0, EFIAPI); >=20 > -- > 2.41.0.windows.3 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107820): https://edk2.groups.io/g/devel/message/107820 Mute This Topic: https://groups.io/mt/100788670/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-