[edk2-devel] [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public

Zhiguang Liu zhiguang.liu at intel.com
Mon Dec 5 07:44:10 UTC 2022


Hi Mike, 
Thanks for the patch. 
One comment is that UnitTestPersistenceLib depends on a struct definition UNIT_TEST_SAVE_HEADER, which is defined in private headers.
Do you think it is ok to also move it into UnitTestPersistenceLib.h?
Or what we really need from the struct in UnitTestPersistenceLib is the SaveStateSize, we can define a new public struct UNIT_TEST_SAVE_HEADER_PUBLIC to only contains the needed fields, like

typedef struct {
  UINT8       Version;
  UINT32      SaveStateSize;                           // Size of the entire serialized buffer.
  UINT8       RawData[]; 
} UNIT_TEST_SAVE_HEADER;

Thanks
Zhiguang

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney at intel.com>
> Sent: Thursday, December 1, 2022 5:20 AM
> To: devel at edk2.groups.io
> Cc: Michael Kubacki <mikuback at linux.microsoft.com>; Sean Brogan
> <sean.brogan at microsoft.com>; Ni, Ray <ray.ni at intel.com>; Liu, Zhiguang
> <zhiguang.liu at intel.com>
> Subject: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
> 
> * Change GoogleTestLib class from private to public.
> * Change UnitTestPersistenceLib class from private to public.
> 
> Cc: Michael Kubacki <mikuback at linux.microsoft.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Zhiguang Liu <zhiguang.liu at intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
> ---
>  .../Library/UnitTestPersistenceLib.h                |  0
>  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec       | 13 +++++++------
>  2 files changed, 7 insertions(+), 6 deletions(-)  rename
> UnitTestFrameworkPkg/{PrivateInclude =>
> Include}/Library/UnitTestPersistenceLib.h (100%)
> 
> diff --git
> a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> similarity index 100%
> rename from
> UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> rename to UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> index ed12f32009d8..14e387d63a0f 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> @@ -26,11 +26,16 @@ [Includes.Common.Private]
>    Library/CmockaLib/cmocka/include/cmockery
>    Library/GoogleTestLib/googletest/googletest
> 
> -[LibraryClasses.Common.Private]
> +[LibraryClasses]
>    ## @libraryclass Allows save and restore unit test internal state
>    #
> -  UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
> +  UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
> 
> +  ## @libraryclass GoogleTest infrastructure  #
> + GoogleTestLib|Include/Library/GoogleTestLib.h
> +
> +[LibraryClasses.Common.Private]
>    ## @libraryclass Provides a unit test result report
>    #
>    UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib.h
> @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
>    #
>    UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
> 
> -  ## @libraryclass GoogleTest infrastructure
> -  #
> -  GoogleTestLib|Include/Library/GoogleTestLib.h
> -
>  [Guids]
>    gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2,
> { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
> 
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96944): https://edk2.groups.io/g/devel/message/96944
Mute This Topic: https://groups.io/mt/95368581/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list