From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.3834.1586829228820725425 for ; Mon, 13 Apr 2020 18:53:49 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: guomin.jiang@intel.com) IronPort-SDR: m1jEtb398/yfD8+rj45l0fX+Bf8C2qzSSS9RpSYhBRWb5e1XRGD2Jimx9ZCu7fOM8aT1YUvix/ 0YoE/UXO1UJg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 18:53:48 -0700 IronPort-SDR: YqEzGVjwSobi3ycXY5k9y4HPWWfVT1dkHX9RssNY7FNr/PpAqjLO4gPpWqM7Dl024tMUU8WSKP SpDMmVI7PMzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,381,1580803200"; d="scan'208";a="245290466" Received: from unknown (HELO guominji-MOBL.ccr.corp.intel.com) ([10.239.158.171]) by fmsmga008.fm.intel.com with ESMTP; 13 Apr 2020 18:53:46 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Bret Barkelew , Michael D Kinney , Liming Gao , Sean Brogan , Bret Barkelew Subject: [PATCH] UnitTestFrameworkPkg/UnitTestLib: Remove FrameworkHandle parameter Date: Tue, 14 Apr 2020 09:53:45 +0800 Message-Id: <20200414015345.2397-1-guomin.jiang@intel.com> X-Mailer: git-send-email 2.25.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2612 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 ( =0D Generally called from within a test case prior to quitting or rebooting.= =0D =0D - @param[in] FrameworkHandle A handle to the current running framework= that=0D - dispatched the test. Necessary for recor= ding=0D - certain test events with the framework.=0D @param[in] ContextToSave A buffer of test case-specific data to be= saved=0D along with framework state. Will be pass= ed as=0D "Context" to the test case upon resume. = This=0D @@ -338,7 +335,6 @@ FreeUnitTestFramework ( EFI_STATUS=0D EFIAPI=0D SaveFrameworkState (=0D - IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,=0D IN UNIT_TEST_CONTEXT ContextToSave OPTIONAL,=0D IN UINTN ContextToSaveSize=0D );=0D 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 ( //=0D // Save current state so if test is started again it doesn't have to run= . It will just report=0D //=0D - SaveFrameworkState (FrameworkHandle, NULL, 0);=0D + SaveFrameworkState (NULL, 0);=0D OutputUnitTestFrameworkReport (FrameworkHandle);=0D =0D mFrameworkHandle =3D NULL;=0D 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 ( =0D Generally called from within a test case prior to quitting or rebooting.= =0D =0D - @param[in] FrameworkHandle A handle to the current running framework= that=0D - dispatched the test. Necessary for recor= ding=0D - certain test events with the framework.=0D @param[in] ContextToSave A buffer of test case-specific data to be= saved=0D along with framework state. Will be pass= ed as=0D "Context" to the test case upon resume. = This=0D @@ -808,21 +805,21 @@ SerializeState ( EFI_STATUS=0D EFIAPI=0D SaveFrameworkState (=0D - IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,=0D IN UNIT_TEST_CONTEXT ContextToSave OPTIONAL,=0D IN UINTN ContextToSaveSize=0D )=0D {=0D - EFI_STATUS Status;=0D - UNIT_TEST_SAVE_HEADER *Header;=0D + EFI_STATUS Status;=0D + UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle;=0D + UNIT_TEST_SAVE_HEADER *Header;=0D =0D Header =3D NULL;=0D + FrameworkHandle =3D GetActiveFrameworkHandle();=0D =0D //=0D // First, let's not make assumptions about the parameters.=0D //=0D - if (FrameworkHandle =3D=3D NULL ||=0D - (ContextToSave !=3D NULL && ContextToSaveSize =3D=3D 0) ||=0D + if ((ContextToSave !=3D NULL && ContextToSaveSize =3D=3D 0) ||=0D ContextToSaveSize > MAX_UINT32) {=0D return EFI_INVALID_PARAMETER;=0D }=0D --=20 2.25.1.windows.1