public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sinha, Ankit" <ankit.sinha@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"mikuback@linux.microsoft.com" <mikuback@linux.microsoft.com>
Cc: "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] PrmPkg/DxePrmContextBufferLib: Fix unit test GCC compilation errors
Date: Wed, 20 Apr 2022 16:18:19 +0000	[thread overview]
Message-ID: <MW5PR11MB59080D8AFDE9E92203EABE51E5F59@MW5PR11MB5908.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220419012717.1557-1-mikuback@linux.microsoft.com>

Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
> Kubacki
> Sent: Monday, April 18, 2022 6:27 PM
> To: devel@edk2.groups.io
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Desimone, Nathaniel
> L <nathaniel.l.desimone@intel.com>; Sinha, Ankit <ankit.sinha@intel.com>
> Subject: [edk2-devel] [PATCH v1 1/1] PrmPkg/DxePrmContextBufferLib: Fix
> unit test GCC compilation errors
> 
> From: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=3905
> 
> Fixes GCC compilation errors in DxePrmContextBufferLibUnitTest.c.
> 
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Ankit Sinha <ankit.sinha@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
> 
> PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLi
> bUnitTest.c | 28 +++++++-------------
>  1 file changed, 10 insertions(+), 18 deletions(-)
> 
> diff --git
> a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBuffer
> LibUnitTest.c
> b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBuffer
> LibUnitTest.c
> index e244e7b09575..fdc32993b82d 100644
> ---
> a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBuffer
> LibUnitTest.c
> +++
> b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBuffer
> +++ LibUnitTest.c
> @@ -237,17 +237,17 @@ NullPointerArgumentsShouldFailGracefully (
>    PRM_MODULE_CONTEXT_BUFFERS  *ModuleContextBuffersPtr;
> 
>    UT_ASSERT_EQUAL (FindContextBufferInModuleBuffers (NULL, NULL,
> NULL), EFI_INVALID_PARAMETER);
> -  UT_ASSERT_EQUAL (FindContextBufferInModuleBuffers (NULL,
> &ModuleContextBuffers, &ContextBufferPtr), EFI_INVALID_PARAMETER);
> -  UT_ASSERT_EQUAL (FindContextBufferInModuleBuffers (&Guid, NULL,
> &ContextBufferPtr), EFI_INVALID_PARAMETER);
> +  UT_ASSERT_EQUAL (FindContextBufferInModuleBuffers (NULL,
> + &ModuleContextBuffers, (CONST PRM_CONTEXT_BUFFER
> + **)&ContextBufferPtr), EFI_INVALID_PARAMETER);  UT_ASSERT_EQUAL
> + (FindContextBufferInModuleBuffers (&Guid, NULL, (CONST
> + PRM_CONTEXT_BUFFER **)&ContextBufferPtr),
> EFI_INVALID_PARAMETER);
>    UT_ASSERT_EQUAL (FindContextBufferInModuleBuffers (&Guid,
> &ModuleContextBuffers, NULL), EFI_INVALID_PARAMETER);
> 
>    UT_ASSERT_EQUAL (GetModuleContextBuffers (ByModuleGuid, NULL,
> NULL), EFI_INVALID_PARAMETER);
> -  UT_ASSERT_EQUAL (GetModuleContextBuffers (ByModuleGuid, NULL,
> &ModuleContextBuffersPtr), EFI_INVALID_PARAMETER);
> +  UT_ASSERT_EQUAL (GetModuleContextBuffers (ByModuleGuid, NULL,
> (CONST
> + PRM_MODULE_CONTEXT_BUFFERS **)&ModuleContextBuffersPtr),
> + EFI_INVALID_PARAMETER);
>    UT_ASSERT_EQUAL (GetModuleContextBuffers (ByModuleGuid, &Guid,
> NULL), EFI_INVALID_PARAMETER);
> 
>    UT_ASSERT_EQUAL (GetContextBuffer (NULL, NULL, NULL),
> EFI_INVALID_PARAMETER);
> -  UT_ASSERT_EQUAL (GetContextBuffer (NULL, &ModuleContextBuffers,
> &ContextBufferPtr), EFI_INVALID_PARAMETER);
> -  UT_ASSERT_EQUAL (GetContextBuffer (&Guid, NULL, &ContextBufferPtr),
> EFI_NOT_FOUND);
> +  UT_ASSERT_EQUAL (GetContextBuffer (NULL, &ModuleContextBuffers,
> + (CONST PRM_CONTEXT_BUFFER **)&ContextBufferPtr),
> + EFI_INVALID_PARAMETER);  UT_ASSERT_EQUAL (GetContextBuffer
> (&Guid,
> + NULL, (CONST PRM_CONTEXT_BUFFER **)&ContextBufferPtr),
> EFI_NOT_FOUND);
>    UT_ASSERT_EQUAL (GetContextBuffer (&Guid, &ModuleContextBuffers,
> NULL), EFI_INVALID_PARAMETER);
> 
>    return UNIT_TEST_PASSED;
> @@ -322,7 +322,7 @@ InitializeFunctionalCorrectness (
> 
>  **/
>  STATIC
> -UNIT_TEST_STATUS
> +VOID
>  EFIAPI
>  DeInitializeFunctionalCorrectness (
>    IN  UNIT_TEST_CONTEXT  Context
> @@ -332,7 +332,6 @@ DeInitializeFunctionalCorrectness (
>    PRM_CONFIG_PROTOCOL               *PrmConfigProtocol;
>    PRM_CONTEXT_BUFFERS_TEST_CONTEXT  *TestContext;
> 
> -  UT_ASSERT_NOT_NULL (Context);
>    TestContext = (PRM_CONTEXT_BUFFERS_TEST_CONTEXT *)Context;
> 
>    Status = gBS->HandleProtocol (
> @@ -340,7 +339,6 @@ DeInitializeFunctionalCorrectness (
>                    &gPrmConfigProtocolGuid,
>                    (VOID **)&PrmConfigProtocol
>                    );
> -  UT_ASSERT_NOT_EFI_ERROR (Status);
> 
>    if (!EFI_ERROR (Status)) {
>      Status =  gBS->UninstallProtocolInterface ( @@ -348,13 +346,10 @@
> DeInitializeFunctionalCorrectness (
>                       &gPrmConfigProtocolGuid,
>                       PrmConfigProtocol
>                       );
> -    UT_ASSERT_NOT_EFI_ERROR (Status);
>      if (!EFI_ERROR (Status)) {
>        FreePool (PrmConfigProtocol);
>      }
>    }
> -
> -  return UNIT_TEST_PASSED;
>  }
> 
>  /**
> @@ -382,7 +377,7 @@ VerifyGetModuleContextBuffers (
>    ContextBuffers = NULL;
>    TestContext    = (PRM_CONTEXT_BUFFERS_TEST_CONTEXT *)Context;
> 
> -  Status = GetModuleContextBuffers (TestContext->GuidSearchType,
> TestContext->Guid, &ContextBuffers);
> +  Status = GetModuleContextBuffers (TestContext->GuidSearchType,
> + TestContext->Guid, (CONST PRM_MODULE_CONTEXT_BUFFERS
> + **)&ContextBuffers);
>    UT_ASSERT_STATUS_EQUAL (Status, TestContext->ExpectedStatus);
> 
>    if (!EFI_ERROR (TestContext->ExpectedStatus)) { @@ -419,14 +414,12 @@
> VerifyFindContextBufferInModuleBuffers (  {
>    EFI_STATUS                       Status;
>    PRM_CONTEXT_BUFFER               *FoundContextBuffer;
> -  PRM_MODULE_CONTEXT_BUFFERS       *ContextBuffers;
>    PRM_CONTEXT_BUFFER_TEST_CONTEXT  *TestContext;
> 
> -  ContextBuffers     = NULL;
>    FoundContextBuffer = NULL;
>    TestContext        = (PRM_CONTEXT_BUFFER_TEST_CONTEXT *)Context;
> 
> -  Status = FindContextBufferInModuleBuffers (TestContext->HandlerGuid,
> TestContext->ContextBuffers, &FoundContextBuffer);
> +  Status = FindContextBufferInModuleBuffers (TestContext->HandlerGuid,
> + TestContext->ContextBuffers, (CONST PRM_CONTEXT_BUFFER
> + **)&FoundContextBuffer);
>    UT_ASSERT_STATUS_EQUAL (Status, TestContext->ExpectedStatus);
> 
>    if (!EFI_ERROR (TestContext->ExpectedStatus)) { @@ -465,14 +458,13 @@
> VerifyGetContextBuffer (  {
>    EFI_STATUS                       Status;
>    PRM_CONTEXT_BUFFER               *FoundContextBuffer;
> -  PRM_MODULE_CONTEXT_BUFFERS       *ContextBuffers;
>    PRM_CONTEXT_BUFFER_TEST_CONTEXT  *TestContext;
> 
> -  ContextBuffers     = NULL;
>    FoundContextBuffer = NULL;
>    TestContext        = (PRM_CONTEXT_BUFFER_TEST_CONTEXT *)Context;
> 
> -  Status = GetContextBuffer (TestContext->HandlerGuid, TestContext-
> >ContextBuffers, &FoundContextBuffer);
> +  Status = GetContextBuffer (TestContext->HandlerGuid,
> + TestContext->ContextBuffers, (CONST PRM_CONTEXT_BUFFER
> + **)&FoundContextBuffer);
> +
>    UT_ASSERT_STATUS_EQUAL (Status, TestContext->ExpectedStatus);
> 
>    if (!EFI_ERROR (TestContext->ExpectedStatus)) {
> --
> 2.28.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#89042): https://edk2.groups.io/g/devel/message/89042
> Mute This Topic: https://groups.io/mt/90553692/1772825
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ankit.sinha@intel.com]
> -=-=-=-=-=-=
> 


      reply	other threads:[~2022-04-20 16:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  1:27 [PATCH v1 1/1] PrmPkg/DxePrmContextBufferLib: Fix unit test GCC compilation errors Michael Kubacki
2022-04-20 16:18 ` Sinha, Ankit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW5PR11MB59080D8AFDE9E92203EABE51E5F59@MW5PR11MB5908.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox