Browse Source

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>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
devel@edk2.groups.io 1 year ago
parent
commit
44fc90eb0e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c

+ 1 - 1
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);