@@ -699,7 +699,10 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenProcess
699699
700700HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMemoryIsCalledOnBufferAndImageTypeAllocationsThenAllocationsHaveAubWritableSetToFalse) {
701701 std::unique_ptr<MemoryManager> memoryManager (nullptr );
702+
702703 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(*platformDevices[0 ], " " , true , *pDevice->executionEnvironment ));
704+ aubCsr->setupContext (*pDevice->getDefaultEngine ().osContext );
705+
703706 memoryManager.reset (aubCsr->createMemoryManager (false , false ));
704707
705708 auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties (MockAllocationProperties{MemoryConstants::pageSize});
@@ -819,6 +822,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupport
819822HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphicsAllocationTypeIsntNonAubWritableThenWriteMemoryIsAllowed) {
820823 std::unique_ptr<MemoryManager> memoryManager (nullptr );
821824 std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr (new AUBCommandStreamReceiverHw<FamilyType>(*platformDevices[0 ], " " , true , *pDevice->executionEnvironment ));
825+ aubCsr->setupContext (*pDevice->getDefaultEngine ().osContext );
826+
822827 memoryManager.reset (aubCsr->createMemoryManager (false , false ));
823828
824829 auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties (MockAllocationProperties{MemoryConstants::pageSize});
@@ -850,6 +855,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenGraphic
850855
851856HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenAllocationDataIsPassedInAllocationViewThenWriteMemoryIsAllowed) {
852857 auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>(*platformDevices[0 ], " " , true , *pDevice->executionEnvironment );
858+ aubCsr->setupContext (*pDevice->getDefaultEngine ().osContext );
853859 size_t size = 100 ;
854860 auto ptr = std::make_unique<char []>(size);
855861 auto addr = reinterpret_cast <uint64_t >(ptr.get ());
@@ -1153,11 +1159,14 @@ TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCa
11531159 EXPECT_FALSE (mockHwContext1->expectMemoryCalled );
11541160 EXPECT_FALSE (mockHwContext0->submitCalled );
11551161 EXPECT_FALSE (mockHwContext1->submitCalled );
1162+ EXPECT_FALSE (mockHwContext0->writeMemoryCalled );
1163+ EXPECT_FALSE (mockHwContext1->writeMemoryCalled );
11561164
11571165 hwContextContainer.initialize ();
11581166 hwContextContainer.pollForCompletion ();
11591167 hwContextContainer.expectMemory (1 , reinterpret_cast <const void *>(0x123 ), 2 , 0 );
11601168 hwContextContainer.submit (1 , reinterpret_cast <const void *>(0x123 ), 2 , 0 , 1 );
1169+ hwContextContainer.writeMemory (1 , reinterpret_cast <const void *>(0x123 ), 2 , 3 , 4 , 5 );
11611170
11621171 EXPECT_TRUE (mockHwContext0->initializeCalled );
11631172 EXPECT_TRUE (mockHwContext1->initializeCalled );
@@ -1167,6 +1176,8 @@ TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCa
11671176 EXPECT_TRUE (mockHwContext1->expectMemoryCalled );
11681177 EXPECT_TRUE (mockHwContext0->submitCalled );
11691178 EXPECT_TRUE (mockHwContext1->submitCalled );
1179+ EXPECT_TRUE (mockHwContext0->writeMemoryCalled );
1180+ EXPECT_TRUE (mockHwContext1->writeMemoryCalled );
11701181}
11711182
11721183TEST_F (HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCalledThenUseFirstContext) {
0 commit comments