From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Hao A Wu <hao.a.wu@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Bret Barkelew <Bret.Barkelew@microsoft.com>,
Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
Date: Wed, 3 Nov 2021 15:59:53 -0700 [thread overview]
Message-ID: <20211103225954.1680-7-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20211103225954.1680-1-michael.d.kinney@intel.com>
When using will_return() on a pointer value, it must be
cast to UINTN to be compatible with 32-bit GCC builds.
This uses the same approach in samples provided in the
UnitTestFramworkPkg when passing pointer values to
UT_ASSERT_EQUAL().
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
.../RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
index 44d70e639d77..880994fe71fc 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c
@@ -287,7 +287,7 @@ LockingAnUnlockedVariableShouldFail (
// With a policy, make sure that writes still work, since the variable doesn't exist.
will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL ); // Attributes
will_return( StubGetVariableNull, 0 ); // Size
- will_return( StubGetVariableNull, NULL ); // DataPtr
+ will_return( StubGetVariableNull, (UINTN)NULL ); // DataPtr
will_return( StubGetVariableNull, EFI_NOT_FOUND); // Status
Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -342,7 +342,7 @@ LockingALockedVariableWithMatchingDataShouldSucceed (
Data = 1;
will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL ); // Attributes
will_return( StubGetVariableNull, sizeof (Data) ); // Size
- will_return( StubGetVariableNull, &Data ); // DataPtr
+ will_return( StubGetVariableNull, (UINTN)&Data ); // DataPtr
will_return( StubGetVariableNull, EFI_SUCCESS); // Status
Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
@@ -397,7 +397,7 @@ LockingALockedVariableWithNonMatchingDataShouldFail (
Data = 2;
will_return( StubGetVariableNull, TEST_POLICY_ATTRIBUTES_NULL ); // Attributes
will_return( StubGetVariableNull, sizeof (Data) ); // Size
- will_return( StubGetVariableNull, &Data ); // DataPtr
+ will_return( StubGetVariableNull, (UINTN)&Data ); // DataPtr
will_return( StubGetVariableNull, EFI_SUCCESS); // Status
Status = VariableLockRequestToLock (NULL, TEST_VAR_1_NAME, &mTestGuid1);
--
2.32.0.windows.1
next prev parent reply other threads:[~2021-11-03 23:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 22:59 [Patch V2 0/7] Fix package build issues Michael D Kinney
2021-11-03 22:59 ` [Patch V2 1/7] DynamicTablesPkg: Add missing BaseStackCheckLib instance Michael D Kinney
2021-11-03 22:59 ` [Patch V2 2/7] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64 Michael D Kinney
2021-11-04 0:20 ` Abner Chang
[not found] ` <16B42FEF94831C39.15345@groups.io>
2021-11-04 0:23 ` [edk2-devel] " Abner Chang
2021-11-03 22:59 ` [Patch V2 3/7] SecurityPkg/SecurityPkg.dsc: Add missing RngLib " Michael D Kinney
2021-11-04 0:21 ` Abner Chang
2021-11-03 22:59 ` [Patch V2 4/7] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping Michael D Kinney
2021-11-04 0:21 ` Abner Chang
2021-11-03 22:59 ` [Patch V2 5/7] UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues Michael D Kinney
2021-11-04 4:59 ` Ni, Ray
2021-11-03 22:59 ` Michael D Kinney [this message]
2021-11-03 23:46 ` [EXTERNAL] [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Bret Barkelew
2021-11-04 0:34 ` [edk2-devel] " Wu, Hao A
2021-11-03 22:59 ` [Patch V2 7/7] BaseTools/Conf: Fix Linux GCC ARM build issues with HII Michael D Kinney
2021-11-04 6:17 ` 回复: [edk2-devel] " gaoliming
2021-11-04 10:49 ` Leif Lindholm
2021-11-04 17:08 ` [edk2-devel] " Michael D Kinney
2021-11-05 3:01 ` 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=20211103225954.1680-7-michael.d.kinney@intel.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