From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.4277.1635980411005838808 for ; Wed, 03 Nov 2021 16:00:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: michael.d.kinney@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="229070030" X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="229070030" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 16:00:10 -0700 X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="729813081" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.88.80]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 16:00:10 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Hao A Wu , Liming Gao , Bret Barkelew , Philippe Mathieu-Daude Subject: [Patch V2 6/7] MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC builds Date: Wed, 3 Nov 2021 15:59:53 -0700 Message-Id: <20211103225954.1680-7-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.32.0.windows.1 In-Reply-To: <20211103225954.1680-1-michael.d.kinney@intel.com> References: <20211103225954.1680-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Cc: Bret Barkelew Signed-off-by: Michael D Kinney Reviewed-by: Philippe Mathieu-Daude --- .../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