@@ -1825,23 +1825,33 @@ TEST(GraphicsAllocation, givenSharedHandleBasedConstructorWhenGraphicsAllocation
18251825}
18261826
18271827TEST (ResidencyDataTest, givenOsContextWhenItIsRegisteredToMemoryManagerThenRefCountIncreases) {
1828- auto osContext = new OsContext (nullptr );
1828+ auto osContext = new OsContext (nullptr , 0u );
18291829 OsAgnosticMemoryManager memoryManager;
18301830 memoryManager.registerOsContext (osContext);
18311831 EXPECT_EQ (1u , memoryManager.getOsContextCount ());
18321832 EXPECT_EQ (1 , osContext->getRefInternalCount ());
18331833}
18341834
1835+ TEST (ResidencyDataTest, givenTwoOsContextsWhenTheyAreRegistredFromHigherToLowerThenProperSizeIsReturned) {
1836+ auto osContext2 = new OsContext (nullptr , 1u );
1837+ auto osContext = new OsContext (nullptr , 0u );
1838+ OsAgnosticMemoryManager memoryManager;
1839+ memoryManager.registerOsContext (osContext2);
1840+ memoryManager.registerOsContext (osContext);
1841+ EXPECT_EQ (2u , memoryManager.getOsContextCount ());
1842+ EXPECT_EQ (1 , osContext->getRefInternalCount ());
1843+ EXPECT_EQ (1 , osContext2->getRefInternalCount ());
1844+ }
1845+
18351846TEST (ResidencyDataTest, givenResidencyDataWhenUpdateCompletionDataIsCalledThenItIsProperlyUpdated) {
18361847 struct mockResidencyData : public ResidencyData {
18371848 using ResidencyData::completionData;
18381849 };
18391850
18401851 mockResidencyData residency;
18411852
1842- OsContext osContext (nullptr );
1843- OsContext osContext2 (nullptr );
1844- osContext2.setContextId (1u );
1853+ OsContext osContext (nullptr , 0u );
1854+ OsContext osContext2 (nullptr , 1u );
18451855
18461856 auto lastFenceValue = 45llu;
18471857 auto lastFenceValue2 = 23llu;
0 commit comments