diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2021-11-02 09:15:26 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-11-05 19:44:11 +0000 |
commit | 4050c873b51f59cb6fcd7665029f931e727e0e4f (patch) | |
tree | b7db9d6a123b338006b1f29e6270002b85acafe8 /MdeModulePkg | |
parent | 15e635d1b5f58461a5d8a03fba026e620b46e59e (diff) | |
download | edk2-4050c873b51f59cb6fcd7665029f931e727e0e4f.zip edk2-4050c873b51f59cb6fcd7665029f931e727e0e4f.tar.gz edk2-4050c873b51f59cb6fcd7665029f931e727e0e4f.tar.bz2 |
MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds
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>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/VariableLockRequestToLockUnitTest.c index 44d70e6..880994f 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);
|