From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (NAM04-CO1-obe.outbound.protection.outlook.com [40.107.69.128]) by mx.groups.io with SMTP id smtpd.web10.4384.1586832374196280778 for ; Mon, 13 Apr 2020 19:46:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=DjdOkkqf; spf=pass (domain: microsoft.com, ip: 40.107.69.128, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aePeQj8DCYVadACDSEsVnXU0ra1kIMy5b2R3hWsLXmab/RsO0/fuq0kGpXSZRhIM+Id+ty0olZz62UJIYWPtLRCKaNjGIdrmxfsbvUHAbWq2eSoTu4MSDbPiX2Cz03tjm4WSh+jXXu2iUkabs10Xun69lgayWPTlyIcEbZMvycHqYAJK0HVEJGVEInDRfYZcNvNmyzPd8iKHmWfNpCZ4XWneTaArR3rzv3Ypsuxp3wv+pX03kiChbA5ApFwxYf7pfUNglDP+fPqLQRA+CrVDneJhAwupgE2Tun7M+eOFK5v4viW3GrliVyeS+JKWCRzGLc1ZzPDCV8BbH1qJuuQKlg== 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-SenderADCheck; bh=fE9va3GdLDSKwPSg9XwsMEfbtyfnwIO6mSWppQdxF2k=; b=TSvdng/tvDC5OwPLXGt7lftFBSKGiHd14KD9A0zxMHgN0+s69wmzmOXdH30zzDTMs41QS7wbJwa1Ol6aXovonvpo+vriK2mmFp38dnARMJ63uptXoVH5AX/WpwlfhzYXzPcdv8rLMm7jCwBe1LJj/j/wMyskHOweri93dj4n55YgR8eKz+mra7nF+liltMyryX0g3yTJ575sTdQDMXnnG2OIHyDrO6BZuMK97OE8+0BYzf7Wy0EEYyHdArh+amczNuSfpfh5DaqOrsMYKE6Bfve65b8jxYx++OWKB9aZCvtsgbrml8J7uVoAOY/TLlgj4MwUT6siQ82SekZ/X8lK6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fE9va3GdLDSKwPSg9XwsMEfbtyfnwIO6mSWppQdxF2k=; b=DjdOkkqfqifvgEUlyVZ3zDMTFv82OXE/uiepzqqd8movRxXvC0U2rqjFQUzyv24fZ9tIySCwUr+x/C1yLbvqovL8L59DKezh3E09eIiWwz86VlJ3Ex7t5e9frmg0yeeYu4wBswyKuyjWKg1DNjhUt1rQofORJFTH7elyQ5Q5Abc= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB1540.namprd21.prod.outlook.com (2603:10b6:910:8a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.5; Tue, 14 Apr 2020 02:46:12 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%11]) with mapi id 15.20.2937.000; Tue, 14 Apr 2020 02:46:12 +0000 From: "Bret Barkelew" To: Guomin Jiang , "devel@edk2.groups.io" CC: "Kinney, Michael D" , Liming Gao , Sean Brogan Subject: Re: [EXTERNAL] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Remove FrameworkHandle parameter Thread-Topic: [EXTERNAL] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Remove FrameworkHandle parameter Thread-Index: AQHWEf+LSuSOgypvSU65DG+13nAg4qh36YDi Date: Tue, 14 Apr 2020 02:46:12 +0000 Message-ID: References: <20200414015345.2397-1-guomin.jiang@intel.com> In-Reply-To: <20200414015345.2397-1-guomin.jiang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-04-14T02:45:24.9592075Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c9e93f36-0a27-4a04-4621-08d7e01dfebe x-ms-traffictypediagnostic: CY4PR21MB1540:|CY4PR21MB1540:|CY4PR21MB1540: x-ms-exchange-transport-forked: True x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0373D94D15 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(346002)(376002)(39860400002)(136003)(366004)(5660300002)(9686003)(186003)(4326008)(966005)(33656002)(82960400001)(2906002)(10290500003)(71200400001)(82950400001)(52536014)(7696005)(316002)(478600001)(110136005)(86362001)(81156014)(107886003)(8676002)(6506007)(54906003)(53546011)(8990500004)(64756008)(66446008)(76116006)(66946007)(55016002)(66476007)(66556008)(8936002)(26005);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: baoBjTnTuCeCnvFyzR1pa7/o6mEBzYc16zmSXwhIl3y3/MBd9UTZZ5s2XSM25NJUD2rr958oEMAafP9E/pFu+B5CwQrwFZMC63jOa1crw4+OTZt4u+vaRnKKG/v+fj/8tG03p+SAR7p6MurNNppqAx7J4zAiIRwdZkCkrWIpyXNzDFZe6HumihEYllzdrVyu5AvSFl/bs5s6rpiznU8Xy2P2Eqdk++kGrvCi4fNf2590ecfRW2SOCXIDOoEicE0qLdVsoon6bK4XHzaRSwKf6WrNdIo4PKDQBZnoTQWPpvviWJD7ggCnDiZOtI7aQQ7Jrz2CgQARxIcagelvu1p/qQD9ws06RdQ3+s33EVE48x7sXSjG95s3wpQUw97R5swquTH9YOdlqvLIgUMWgusn7bHsQg/Sjb/ZwES4EnG181+L5STJevOVMRFR8SgoqSGMpkh6g8cxr7MhxNci5e/1O52/mTQjCxXckbmXaB2T3LRWrU2YYukUQGXuMzQ019XKHSow6aWVaK5sjTinpmWjzQ== x-ms-exchange-antispam-messagedata: 57j7yXZx6XAeHtygO28Qcr9DB+khS89225owFwWtIbmHQ5e+4VIN2yGNpdy/SnA51ti7SHciHKjXyYahcBGVnoejSebvOKKQWxK1U0aVYW3wmHPCTiJZbWMp0rUhvxtoiXfQTaCHyTiKy1cYtY+CHw== MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9e93f36-0a27-4a04-4621-08d7e01dfebe X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2020 02:46:12.7321 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eSOR3mIaC9ZKVT0Dxk2mWEprCYdcC/hd3uEjJO9tNlFnv5yodYrYsY7c8avVTI39QQgbf28b5iqCNQIjxrDMjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB1540 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB07431B11C1505A39A030FB4BEFDA0CY4PR21MB0743namp_" --_000_CY4PR21MB07431B11C1505A39A030FB4BEFDA0CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret From: Guomin Jiang Sent: Monday, April 13, 2020 6:53 PM To: devel@edk2.groups.io Cc: Bret Barkelew; Kinney, Michael D; Liming Gao; = Sean Brogan; Bret Barkelew Subject: [EXTERNAL] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Remove Framew= orkHandle parameter From: Bret Barkelew REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2612&data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7Cffe40198dda04043796c08d7e016acfd%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637224260308125582&sdata=3DIlxdkaz%2BRcTdU= 6bvTRPB394PGKWZ0TQibcN4NaYDBEg%3D&reserved=3D0 Remove the FrameworkHandle parameter from the SaveFrameworkState interface in UnitTestLib Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Cc: Bret Barkelew Signed-off-by: Guomin Jiang --- MdePkg/Include/Library/UnitTestLib.h | 4 ---- UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c | 2 +- .../Library/UnitTestLib/UnitTestLib.c | 13 +++++-------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/MdePkg/Include/Library/UnitTestLib.h b/MdePkg/Include/Library/= UnitTestLib.h index c06c36bea5..38e4652959 100644 --- a/MdePkg/Include/Library/UnitTestLib.h +++ b/MdePkg/Include/Library/UnitTestLib.h @@ -315,9 +315,6 @@ FreeUnitTestFramework ( Generally called from within a test case prior to quitting or rebooting. - @param[in] FrameworkHandle A handle to the current running framework= that - dispatched the test. Necessary for recor= ding - certain test events with the framework. @param[in] ContextToSave A buffer of test case-specific data to be= saved along with framework state. Will be pass= ed as "Context" to the test case upon resume. = This @@ -338,7 +335,6 @@ FreeUnitTestFramework ( EFI_STATUS EFIAPI SaveFrameworkState ( - IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, IN UNIT_TEST_CONTEXT ContextToSave OPTIONAL, IN UINTN ContextToSaveSize ); diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c b/UnitTest= FrameworkPkg/Library/UnitTestLib/RunTests.c index b053e04959..793335fd0f 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c @@ -162,7 +162,7 @@ RunAllTestSuites ( // // Save current state so if test is started again it doesn't have to run= . It will just report // - SaveFrameworkState (FrameworkHandle, NULL, 0); + SaveFrameworkState (NULL, 0); OutputUnitTestFrameworkReport (FrameworkHandle); mFrameworkHandle =3D NULL; diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitT= estFrameworkPkg/Library/UnitTestLib/UnitTestLib.c index b136992d99..9a701d1047 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c @@ -785,9 +785,6 @@ SerializeState ( Generally called from within a test case prior to quitting or rebooting. - @param[in] FrameworkHandle A handle to the current running framework= that - dispatched the test. Necessary for recor= ding - certain test events with the framework. @param[in] ContextToSave A buffer of test case-specific data to be= saved along with framework state. Will be pass= ed as "Context" to the test case upon resume. = This @@ -808,21 +805,21 @@ SerializeState ( EFI_STATUS EFIAPI SaveFrameworkState ( - IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, IN UNIT_TEST_CONTEXT ContextToSave OPTIONAL, IN UINTN ContextToSaveSize ) { - EFI_STATUS Status; - UNIT_TEST_SAVE_HEADER *Header; + EFI_STATUS Status; + UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle; + UNIT_TEST_SAVE_HEADER *Header; Header =3D NULL; + FrameworkHandle =3D GetActiveFrameworkHandle(); // // First, let's not make assumptions about the parameters. // - if (FrameworkHandle =3D=3D NULL || - (ContextToSave !=3D NULL && ContextToSaveSize =3D=3D 0) || + if ((ContextToSave !=3D NULL && ContextToSaveSize =3D=3D 0) || ContextToSaveSize > MAX_UINT32) { return EFI_INVALID_PARAMETER; } -- 2.25.1.windows.1 --_000_CY4PR21MB07431B11C1505A39A030FB4BEFDA0CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@microso= ft.com>

 

- Bret

 

From: Guomin Jiang
Sent: Monday, April 13, 2020 6:53 PM
To: devel@edk2.groups.io=
Cc: Bret Barkelew= ; Kinney, Michael D; Liming Gao; Sean Brogan; Bret Barkel= ew
Subject: [EXTERNAL] [PATCH] UnitTestFrameworkPkg/UnitTestLib: Remove= FrameworkHandle parameter

 

From: Bret Barkelew &= lt;brbarkel@microsoft.com>

REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzill= a.tianocore.org%2Fshow_bug.cgi%3Fid%3D2612&amp;data=3D02%7C01%7CBret.Ba= rkelew%40microsoft.com%7Cffe40198dda04043796c08d7e016acfd%7C72f988bf86f141a= f91ab2d7cd011db47%7C1%7C0%7C637224260308125582&amp;sdata=3DIlxdkaz%2BRc= TdU6bvTRPB394PGKWZ0TQibcN4NaYDBEg%3D&amp;reserved=3D0

Remove the FrameworkHandle parameter from the SaveFrameworkState interface<= br> in UnitTestLib

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@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>
---
 MdePkg/Include/Library/UnitTestLib.h     &nb= sp;          |  4 ----  UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c |  2 +-<= br>  .../Library/UnitTestLib/UnitTestLib.c     &n= bsp;         | 13 +++&#= 43;+--------
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/MdePkg/Include/Library/UnitTestLib.h b/MdePkg/Include/Library/= UnitTestLib.h
index c06c36bea5..38e4652959 100644
--- a/MdePkg/Include/Library/UnitTestLib.h
+++ b/MdePkg/Include/Library/UnitTestLib.h
@@ -315,9 +315,6 @@ FreeUnitTestFramework (
 

   Generally called from within a test case prior to quitting or = rebooting.

 

-  @param[in]  FrameworkHandle    A handle to the = current running framework that

-            &n= bsp;            = ;        dispatched the test.  Nece= ssary for recording

-            &n= bsp;            = ;        certain test events with the fr= amework.

   @param[in]  ContextToSave      A= buffer of test case-specific data to be saved

            &nb= sp;            =          along with framework state= .  Will be passed as

            &nb= sp;            =          "Context" to the= test case upon resume.  This

@@ -338,7 +335,6 @@ FreeUnitTestFramework (
 EFI_STATUS

 EFIAPI

 SaveFrameworkState (

-  IN UNIT_TEST_FRAMEWORK_HANDLE  FrameworkHandle,

   IN UNIT_TEST_CONTEXT       =     ContextToSave     OPTIONAL,

   IN UINTN         =             &nb= sp; ContextToSaveSize

   );

diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c b/UnitTest= FrameworkPkg/Library/UnitTestLib/RunTests.c
index b053e04959..793335fd0f 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c
@@ -162,7 +162,7 @@ RunAllTestSuites (
   //

   // Save current state so if test is started again it doesn't h= ave to run.  It will just report

   //

-  SaveFrameworkState (FrameworkHandle, NULL, 0);

+  SaveFrameworkState (NULL, 0);

   OutputUnitTestFrameworkReport (FrameworkHandle);

 

   mFrameworkHandle =3D NULL;

diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitT= estFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
index b136992d99..9a701d1047 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c @@ -785,9 +785,6 @@ SerializeState (
 

   Generally called from within a test case prior to quitting or = rebooting.

 

-  @param[in]  FrameworkHandle    A handle to the = current running framework that

-            &n= bsp;            = ;        dispatched the test.  Nece= ssary for recording

-            &n= bsp;            = ;        certain test events with the fr= amework.

   @param[in]  ContextToSave      A= buffer of test case-specific data to be saved

            &nb= sp;            =          along with framework state= .  Will be passed as

            &nb= sp;            =          "Context" to the= test case upon resume.  This

@@ -808,21 +805,21 @@ SerializeState (
 EFI_STATUS

 EFIAPI

 SaveFrameworkState (

-  IN UNIT_TEST_FRAMEWORK_HANDLE  FrameworkHandle,

   IN UNIT_TEST_CONTEXT       =     ContextToSave     OPTIONAL,

   IN UINTN         =             &nb= sp; ContextToSaveSize

   )

 {

-  EFI_STATUS         &nb= sp;   Status;

-  UNIT_TEST_SAVE_HEADER  *Header;

+  EFI_STATUS         = ;         Status;

+  UNIT_TEST_FRAMEWORK_HANDLE  FrameworkHandle;

+  UNIT_TEST_SAVE_HEADER       *Head= er;

 

   Header =3D NULL;

+  FrameworkHandle =3D GetActiveFrameworkHandle();

 

   //

   // First, let's not make assumptions about the parameters.

   //

-  if (FrameworkHandle =3D=3D NULL ||

-      (ContextToSave !=3D NULL && Context= ToSaveSize =3D=3D 0) ||

+  if ((ContextToSave !=3D NULL && ContextToSaveSize =3D= =3D 0) ||

       ContextToSaveSize > MAX_UINT32) {
     return EFI_INVALID_PARAMETER;

   }

--
2.25.1.windows.1

 

--_000_CY4PR21MB07431B11C1505A39A030FB4BEFDA0CY4PR21MB0743namp_--