From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.27958.1669849610798586138 for ; Wed, 30 Nov 2022 15:06:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=Rtikqqat; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id DE6EB20B83C2; Wed, 30 Nov 2022 15:06:49 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DE6EB20B83C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1669849610; bh=QzyEJkytfyvJ8oVx3gHJbYlSFEIEkC7vvOuHO42h1Hk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Rtikqqatvekaee6/4h+l3ofRZP/vXlQN+u1jh8lV8cVnIcrxl82IjgMZFZlerr8hS p+VYp6oEdPwgEcZqIiLrmQg2ek6HHWdmXSB2KIyO6jDHPUslRIxZU5SKxbcsoywC1O 2pIzufwH76dMZSv7+CvZNXrvUcs0wUSL2EYeDalw= Message-ID: Date: Wed, 30 Nov 2022 18:06:48 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [edk2-devel] [PATCH v3] UnitTestFrameworkPkg/UnitTestLib: Print expected Status on ASSERT fail To: devel@edk2.groups.io, jeshuas@nvidia.com Cc: michael.d.kinney@intel.com, sean.brogan@microsoft.com References: From: "Michael Kubacki" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: Michael Kubacki 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 > --- > 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);