UefiCpuPkg/MtrrUnitTest: Update UnitTestMtrrGetFixedMtrr().
UnitTestMtrrGetFixedMtrr updated for the case that fixed MtrrLib is not always supported. Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
		| @@ -650,6 +650,19 @@ UnitTestMtrrGetFixedMtrr ( | ||||
|   UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings); | ||||
|   UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (ExpectedFixedSettings)); | ||||
|  | ||||
|   // | ||||
|   // Negative test case when Fixed MTRRs are not supported | ||||
|   // | ||||
|   SystemParameter.MtrrSupported      = TRUE; | ||||
|   SystemParameter.FixedMtrrSupported = FALSE; | ||||
|   InitializeMtrrRegs (&SystemParameter); | ||||
|  | ||||
|   ZeroMem (&FixedSettings, sizeof (FixedSettings)); | ||||
|   ZeroMem (&ExpectedFixedSettings, sizeof (ExpectedFixedSettings)); | ||||
|   Result = MtrrGetFixedMtrr (&FixedSettings); | ||||
|   UT_ASSERT_EQUAL ((UINTN)Result, (UINTN)&FixedSettings); | ||||
|   UT_ASSERT_MEM_EQUAL (&ExpectedFixedSettings, &FixedSettings, sizeof (ExpectedFixedSettings)); | ||||
|  | ||||
|   return UNIT_TEST_PASSED; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user