public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeshua Smith" <jeshuas@nvidia.com>
To: <devel@edk2.groups.io>
Cc: <michael.d.kinney@intel.com>, <mikuback@linux.microsoft.com>,
	<sean.brogan@microsoft.com>, Jeshua Smith <jeshuas@nvidia.com>
Subject: [PATCH v2] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail
Date: Wed, 30 Nov 2022 22:58:46 +0000	[thread overview]
Message-ID: <a029b1a29fa55f5026e2558564d878ed55dc6614.1669847682.git.jeshuas@nvidia.com> (raw)

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

Change-Id: Ic651584dcdbcf1f8cd8166ad8058744fc0587d72
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


             reply	other threads:[~2022-11-30 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 22:58 Jeshua Smith [this message]
2022-11-30 23:03 ` [PATCH v2] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail Michael D Kinney

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=a029b1a29fa55f5026e2558564d878ed55dc6614.1669847682.git.jeshuas@nvidia.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