|
13 | 13 | #include "unit_tests/mocks/mock_csr.h" |
14 | 14 | #include "unit_tests/mocks/mock_device.h" |
15 | 15 | #include "unit_tests/mocks/mock_graphics_allocation.h" |
| 16 | +#include "unit_tests/mocks/mock_memory_manager.h" |
| 17 | +#include "unit_tests/helpers/execution_environment_helper.h" |
16 | 18 |
|
17 | 19 | #include "test.h" |
18 | 20 | #include <memory> |
@@ -120,14 +122,22 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverWithActiveDebuggerTest, givenCs |
120 | 122 | using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; |
121 | 123 | using STATE_SIP = typename FamilyType::STATE_SIP; |
122 | 124 |
|
123 | | - auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)); |
| 125 | + HardwareInfo *hwInfo = nullptr; |
| 126 | + auto executionEnvironment = getExecutionEnvironmentImpl(hwInfo); |
| 127 | + hwInfo->capabilityTable = platformDevices[0]->capabilityTable; |
| 128 | + hwInfo->capabilityTable.sourceLevelDebuggerSupported = true; |
| 129 | + |
| 130 | + auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0], *executionEnvironment); |
| 131 | + |
| 132 | + executionEnvironment->commandStreamReceivers.resize(1); |
| 133 | + executionEnvironment->commandStreamReceivers[0][0].reset(mockCsr); |
| 134 | + auto mockMemoryManager = new MockMemoryManager(*executionEnvironment); |
| 135 | + executionEnvironment->memoryManager.reset(mockMemoryManager); |
124 | 136 |
|
| 137 | + auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(&hwInfo[0], executionEnvironment, 0)); |
125 | 138 | if (device->getHardwareInfo().capabilityTable.defaultPreemptionMode == PreemptionMode::MidThread) { |
126 | 139 | device->setSourceLevelDebuggerActive(true); |
127 | 140 | device->allocatePreemptionAllocationIfNotPresent(); |
128 | | - auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0], *device->executionEnvironment); |
129 | | - |
130 | | - device->resetCommandStreamReceiver(mockCsr); |
131 | 141 |
|
132 | 142 | mockCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch); |
133 | 143 |
|
|
0 commit comments