public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
@ 2022-11-30 23:02 Jeshua Smith
  2022-11-30 23:06 ` [edk2-devel] " Michael Kubacki
  2022-12-14 23:09 ` Michael D Kinney
  0 siblings, 2 replies; 5+ messages in thread
From: Jeshua Smith @ 2022-11-30 23:02 UTC (permalink / raw)
  To: devel; +Cc: michael.d.kinney, mikuback, sean.brogan, Jeshua Smith

Update the UnitTestAssertStatusEqual error message to print out the
expected value in addition to the seen value.

Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
---
 UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
index dc05bbd438..0d8e36c938 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
@@ -290,7 +290,7 @@ UnitTestAssertStatusEqual (
 {
   CHAR8  TempStr[MAX_STRING_SIZE];
 
-  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
+  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p expected:%p)", Description, (VOID *)Status, (VOID *)Expected);
   _assert_true ((Status == Expected), TempStr, FileName, (INT32)LineNumber);
 
   return (Status == Expected);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
  2022-11-30 23:02 [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail Jeshua Smith
@ 2022-11-30 23:06 ` Michael Kubacki
  2022-12-14 15:28   ` Jeshua Smith
  2022-12-14 23:09 ` Michael D Kinney
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Kubacki @ 2022-11-30 23:06 UTC (permalink / raw)
  To: devel, jeshuas; +Cc: michael.d.kinney, sean.brogan

Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

On 11/30/2022 6:02 PM, Jeshua Smith via groups.io wrote:
> Update the UnitTestAssertStatusEqual error message to print out the
> expected value in addition to the seen value.
> 
> Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
> ---
>   UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> index dc05bbd438..0d8e36c938 100644
> --- a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> @@ -290,7 +290,7 @@ UnitTestAssertStatusEqual (
>   {
>     CHAR8  TempStr[MAX_STRING_SIZE];
>   
> -  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
> +  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p expected:%p)", Description, (VOID *)Status, (VOID *)Expected);
>     _assert_true ((Status == Expected), TempStr, FileName, (INT32)LineNumber);
>   
>     return (Status == Expected);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
  2022-11-30 23:06 ` [edk2-devel] " Michael Kubacki
@ 2022-12-14 15:28   ` Jeshua Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Jeshua Smith @ 2022-12-14 15:28 UTC (permalink / raw)
  To: Michael Kubacki, devel@edk2.groups.io
  Cc: michael.d.kinney@intel.com, sean.brogan@microsoft.com

Is there anything blocking this patch from being merged?

-----Original Message-----
From: Michael Kubacki <mikuback@linux.microsoft.com> 
Sent: Wednesday, November 30, 2022 4:07 PM
To: devel@edk2.groups.io; Jeshua Smith <jeshuas@nvidia.com>
Cc: michael.d.kinney@intel.com; sean.brogan@microsoft.com
Subject: Re: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail

External email: Use caution opening links or attachments


Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

On 11/30/2022 6:02 PM, Jeshua Smith via groups.io wrote:
> Update the UnitTestAssertStatusEqual error message to print out the 
> expected value in addition to the seen value.
>
> Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
> ---
>   UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c 
> b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> index dc05bbd438..0d8e36c938 100644
> --- a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> @@ -290,7 +290,7 @@ UnitTestAssertStatusEqual (
>   {
>     CHAR8  TempStr[MAX_STRING_SIZE];
>
> -  snprintf (TempStr, sizeof (TempStr), 
> "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
> +  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p 
> + expected:%p)", Description, (VOID *)Status, (VOID *)Expected);
>     _assert_true ((Status == Expected), TempStr, FileName, 
> (INT32)LineNumber);
>
>     return (Status == Expected);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
  2022-11-30 23:02 [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail Jeshua Smith
  2022-11-30 23:06 ` [edk2-devel] " Michael Kubacki
@ 2022-12-14 23:09 ` Michael D Kinney
  2022-12-14 23:49   ` Michael D Kinney
  1 sibling, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2022-12-14 23:09 UTC (permalink / raw)
  To: devel@edk2.groups.io, jeshuas@nvidia.com, Kinney, Michael D
  Cc: mikuback@linux.microsoft.com, sean.brogan@microsoft.com

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jeshua Smith via groups.io
> Sent: Wednesday, November 30, 2022 3:02 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; mikuback@linux.microsoft.com; sean.brogan@microsoft.com; Jeshua Smith
> <jeshuas@nvidia.com>
> Subject: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
> 
> Update the UnitTestAssertStatusEqual error message to print out the
> expected value in addition to the seen value.
> 
> Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
> ---
>  UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> index dc05bbd438..0d8e36c938 100644
> --- a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> @@ -290,7 +290,7 @@ UnitTestAssertStatusEqual (
>  {
>    CHAR8  TempStr[MAX_STRING_SIZE];
> 
> -  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
> +  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p expected:%p)", Description, (VOID *)Status, (VOID
> *)Expected);
>    _assert_true ((Status == Expected), TempStr, FileName, (INT32)LineNumber);
> 
>    return (Status == Expected);
> --
> 2.25.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
  2022-12-14 23:09 ` Michael D Kinney
@ 2022-12-14 23:49   ` Michael D Kinney
  0 siblings, 0 replies; 5+ messages in thread
From: Michael D Kinney @ 2022-12-14 23:49 UTC (permalink / raw)
  To: devel@edk2.groups.io, jeshuas@nvidia.com, Kinney, Michael D
  Cc: mikuback@linux.microsoft.com, sean.brogan@microsoft.com

Merged

PR: https://github.com/tianocore/edk2/pull/3771
Commit: https://github.com/tianocore/edk2/commit/44fc90eb0ea7299abc79577db55aa6257b46b7ae

Mike

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Wednesday, December 14, 2022 3:10 PM
> To: devel@edk2.groups.io; jeshuas@nvidia.com; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: mikuback@linux.microsoft.com; sean.brogan@microsoft.com
> Subject: RE: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jeshua Smith via groups.io
> > Sent: Wednesday, November 30, 2022 3:02 PM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; mikuback@linux.microsoft.com; sean.brogan@microsoft.com; Jeshua
> Smith
> > <jeshuas@nvidia.com>
> > Subject: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
> >
> > Update the UnitTestAssertStatusEqual error message to print out the
> > expected value in addition to the seen value.
> >
> > Signed-off-by: Jeshua Smith <jeshuas@nvidia.com>
> > ---
> >  UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> > b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> > index dc05bbd438..0d8e36c938 100644
> > --- a/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> > +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
> > @@ -290,7 +290,7 @@ UnitTestAssertStatusEqual (
> >  {
> >    CHAR8  TempStr[MAX_STRING_SIZE];
> >
> > -  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
> > +  snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p expected:%p)", Description, (VOID *)Status, (VOID
> > *)Expected);
> >    _assert_true ((Status == Expected), TempStr, FileName, (INT32)LineNumber);
> >
> >    return (Status == Expected);
> > --
> > 2.25.1
> >
> >
> >
> > 
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-14 23:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 23:02 [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail Jeshua Smith
2022-11-30 23:06 ` [edk2-devel] " Michael Kubacki
2022-12-14 15:28   ` Jeshua Smith
2022-12-14 23:09 ` Michael D Kinney
2022-12-14 23:49   ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox