Reverse logic of creating Memory Manager - part 6

-Remove a redundant condition from the MemoryManager constructor

Change-Id: I4b6c56f30a19e77a7a20f68c6d85516aaa52d102
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-03-28 15:42:23 +01:00
committed by sys_ocldev
parent e772321e82
commit a025dc6985
30 changed files with 152 additions and 120 deletions

View File

@@ -27,6 +27,7 @@
#include "unit_tests/mocks/mock_builtins.h"
#include "unit_tests/mocks/mock_context.h"
#include "unit_tests/mocks/mock_csr.h"
#include "unit_tests/mocks/mock_execution_environment.h"
#include "unit_tests/mocks/mock_graphics_allocation.h"
#include "unit_tests/mocks/mock_memory_manager.h"
#include "unit_tests/mocks/mock_program.h"
@@ -343,7 +344,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye
auto mockGraphicsAllocation = new MockGraphicsAllocationWithDestructorTracing(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0llu, 0llu, 1u, MemoryPool::MemoryNull, false);
mockGraphicsAllocation->destructorCalled = &destructorCalled;
ExecutionEnvironment executionEnvironment;
MockExecutionEnvironment executionEnvironment(*platformDevices);
executionEnvironment.commandStreamReceivers.resize(1);
executionEnvironment.commandStreamReceivers[0].push_back(std::make_unique<MockCommandStreamReceiver>(executionEnvironment));
auto csr = executionEnvironment.commandStreamReceivers[0][0].get();
@@ -355,7 +356,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenItIsDestroye
}
TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTagAllocationIsCalledThenTagAllocationIsBeingAllocated) {
ExecutionEnvironment executionEnvironment;
MockExecutionEnvironment executionEnvironment(*platformDevices);
auto csr = new MockCommandStreamReceiver(executionEnvironment);
executionEnvironment.commandStreamReceivers.resize(1);
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
@@ -371,7 +372,7 @@ TEST(CommandStreamReceiverSimpleTest, givenCommandStreamReceiverWhenInitializeTa
TEST(CommandStreamReceiverSimpleTest, givenNullHardwareDebugModeWhenInitializeTagAllocationIsCalledThenTagAllocationIsBeingAllocatedAndinitialValueIsMinusOne) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableNullHardware.set(true);
ExecutionEnvironment executionEnvironment;
MockExecutionEnvironment executionEnvironment(*platformDevices);
executionEnvironment.commandStreamReceivers.resize(1);
auto csr = new MockCommandStreamReceiver(executionEnvironment);
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));