summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
index 75ae4d6..1d3573e 100644
--- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
+++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
@@ -904,18 +904,24 @@ UnitTestMtrrGetDefaultMemoryType (
Result = MtrrGetDefaultMemoryType ();
UT_ASSERT_EQUAL (Result, CacheUncacheable);
+ //
+ // If MTRRs are supported, but Fixed MTRRs are not supported.
+ //
SystemParameter.MtrrSupported = TRUE;
SystemParameter.FixedMtrrSupported = FALSE;
InitializeMtrrRegs (&SystemParameter);
Result = MtrrGetDefaultMemoryType ();
- UT_ASSERT_EQUAL (Result, CacheUncacheable);
+ UT_ASSERT_EQUAL (Result, SystemParameter.DefaultCacheType);
+ //
+ // If MTRRs are supported, but Variable MTRRs are not supported.
+ //
SystemParameter.MtrrSupported = TRUE;
SystemParameter.FixedMtrrSupported = TRUE;
SystemParameter.VariableMtrrCount = 0;
InitializeMtrrRegs (&SystemParameter);
Result = MtrrGetDefaultMemoryType ();
- UT_ASSERT_EQUAL (Result, CacheUncacheable);
+ UT_ASSERT_EQUAL (Result, SystemParameter.DefaultCacheType);
return UNIT_TEST_PASSED;
}