test: Adjust direct submission tests

Disable direct submission at the end of the test for cases where
direct submission is enabled in test body.

Adjust mock csr to restore os context in cases where
context has been replaced in test body.

Related-To: NEO-15017

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2025-07-10 08:21:57 +00:00
committed by Compute-Runtime-Automation
parent c9ebf91271
commit f8dc80c7fc
12 changed files with 58 additions and 32 deletions

View File

@@ -363,7 +363,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenAssignedTaskCountAb
executionEnvironment.initializeMemoryManager();
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
csr.osContext = osContext.get();
csr.setupContext(*osContext);
MockGraphicsAllocationTaskCount::getTaskCountCalleedTimes = 0;
MockGraphicsAllocationTaskCount graphicsAllocation;
graphicsAllocation.hostPtrTaskCountAssignment = 1;
@@ -376,7 +376,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountHigherTha
executionEnvironment.initializeMemoryManager();
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
csr.osContext = osContext.get();
csr.setupContext(*osContext);
MockGraphicsAllocationTaskCount graphicsAllocation;
graphicsAllocation.updateTaskCount(10u, 0u);
*csr.getTagAddress() = 5;
@@ -390,7 +390,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountLowerThan
executionEnvironment.initializeMemoryManager();
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
csr.osContext = osContext.get();
csr.setupContext(*osContext);
MockGraphicsAllocationTaskCount graphicsAllocation;
graphicsAllocation.updateTaskCount(5u, 0u);
csr.taskCount = 10;
@@ -404,7 +404,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountNotUsedLo
executionEnvironment.initializeMemoryManager();
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
csr.osContext = osContext.get();
csr.setupContext(*osContext);
MockGraphicsAllocationTaskCount graphicsAllocation;
graphicsAllocation.updateTaskCount(GraphicsAllocation::objectNotResident, 0u);
csr.taskCount = 10;
@@ -418,7 +418,7 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationAllocTaskCountLowerThan
executionEnvironment.initializeMemoryManager();
auto osContext = std::unique_ptr<OsContext>(OsContext::create(nullptr, 0, 0, EngineDescriptorHelper::getDefaultDescriptor()));
MockCommandStreamReceiver csr(executionEnvironment, 0, 1);
csr.osContext = osContext.get();
csr.setupContext(*osContext);
MockGraphicsAllocationTaskCount graphicsAllocation;
graphicsAllocation.updateTaskCount(5u, 0u);
csr.taskCount = 10;