mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 08:07:19 +08:00
Minor refactoring related to residency task count
Change-Id: I49c9a5b37637e19fa12b7e6d91c352fb78bb117a Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
068582445d
commit
b138ff5750
@@ -84,9 +84,31 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenUpdatedResidencyTaskCoun
|
||||
|
||||
TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenResetResidencyTaskCountThenAllocationIsNotResident) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.updateResidencyTaskCount(1, 0u);
|
||||
graphicsAllocation.updateResidencyTaskCount(1u, 0u);
|
||||
EXPECT_TRUE(graphicsAllocation.isResident(0u));
|
||||
|
||||
graphicsAllocation.resetResidencyTaskCount(0u);
|
||||
EXPECT_FALSE(graphicsAllocation.isResident(0u));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, givenNonResidentGraphicsAllocationWhenCheckIfResidencyTaskCountIsBelowAnyValueThenReturnTrue) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
EXPECT_FALSE(graphicsAllocation.isResident(0u));
|
||||
EXPECT_TRUE(graphicsAllocation.isResidencyTaskCountBelow(0u, 0u));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenCheckIfResidencyTaskCountIsBelowCurrentResidencyTaskCountThenReturnFalse) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
auto currentResidencyTaskCount = 1u;
|
||||
graphicsAllocation.updateResidencyTaskCount(currentResidencyTaskCount, 0u);
|
||||
EXPECT_TRUE(graphicsAllocation.isResident(0u));
|
||||
EXPECT_FALSE(graphicsAllocation.isResidencyTaskCountBelow(currentResidencyTaskCount, 0u));
|
||||
}
|
||||
|
||||
TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenCheckIfResidencyTaskCountIsBelowHigherThanCurrentResidencyTaskCountThenReturnTrue) {
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
auto currentResidencyTaskCount = 1u;
|
||||
graphicsAllocation.updateResidencyTaskCount(currentResidencyTaskCount, 0u);
|
||||
EXPECT_TRUE(graphicsAllocation.isResident(0u));
|
||||
EXPECT_TRUE(graphicsAllocation.isResidencyTaskCountBelow(currentResidencyTaskCount + 1u, 0u));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user