diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2021-11-02 09:08:18 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-11-05 19:44:11 +0000 |
commit | 15e635d1b5f58461a5d8a03fba026e620b46e59e (patch) | |
tree | 6463ed4100f99805c9cc621802b2493f2caacbf0 | |
parent | b0a03ca4a9763ed85f560303902d289d87e53762 (diff) | |
download | edk2-15e635d1b5f58461a5d8a03fba026e620b46e59e.tar.gz |
UefiCpuPkg/MtrrLib/UnitTest: Fix 32-bit GCC build issues
When using UT_ASSERT_EQUAL() on a pointer value, it must be
cast to UINTN. This follows the samples provided with the
UnitTestFrameworkPkg.
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
-rw-r--r-- | UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c index 30ee1dc325..e84b939060 100644 --- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c +++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c @@ -599,7 +599,7 @@ UnitTestMtrrGetFixedMtrr ( }
Result = MtrrGetFixedMtrr (&FixedSettings);
- UT_ASSERT_EQUAL (Result, &FixedSettings);
+ UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings);
UT_ASSERT_MEM_EQUAL (&FixedSettings, &ExpectedFixedSettings, sizeof (FixedSettings));
}
@@ -612,7 +612,7 @@ UnitTestMtrrGetFixedMtrr ( ZeroMem (&FixedSettings, sizeof (FixedSettings));
ZeroMem (&ExpectedFixedSettings, sizeof (ExpectedFixedSettings));
Result = MtrrGetFixedMtrr (&FixedSettings);
- UT_ASSERT_EQUAL (Result, &FixedSettings);
+ UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings);
UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (ExpectedFixedSettings));
return UNIT_TEST_PASSED;
@@ -653,7 +653,7 @@ UnitTestMtrrGetAllMtrrs ( AsmWriteMsr64 (MSR_IA32_MTRR_PHYSMASK0 + (Index << 1), VariableMtrr[Index].Mask);
}
Result = MtrrGetAllMtrrs (&Mtrrs);
- UT_ASSERT_EQUAL (Result, &Mtrrs);
+ UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
UT_ASSERT_MEM_EQUAL (Mtrrs.Variables.Mtrr, VariableMtrr, sizeof (MTRR_VARIABLE_SETTING) * SystemParameter.VariableMtrrCount);
//
@@ -665,7 +665,7 @@ UnitTestMtrrGetAllMtrrs ( SystemParameter.MtrrSupported = FALSE;
InitializeMtrrRegs (&SystemParameter);
Result = MtrrGetAllMtrrs (&Mtrrs);
- UT_ASSERT_EQUAL (Result, &Mtrrs);
+ UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
UT_ASSERT_MEM_EQUAL (&ExpectedMtrrs, &Mtrrs, sizeof (ExpectedMtrrs));
//
@@ -718,7 +718,7 @@ UnitTestMtrrSetAllMtrrs ( GenerateRandomMtrrPair (SystemParameter.PhysicalAddressBits, GenerateRandomCacheType (), &Mtrrs.Variables.Mtrr[Index], NULL);
}
Result = MtrrSetAllMtrrs (&Mtrrs);
- UT_ASSERT_EQUAL (Result, &Mtrrs);
+ UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&Mtrrs);
UT_ASSERT_EQUAL (AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE), Mtrrs.MtrrDefType);
for (Index = 0; Index < SystemParameter.VariableMtrrCount; Index++) {
|