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

@@ -18,6 +18,7 @@
#include "unit_tests/mocks/mock_command_queue.h"
#include "unit_tests/mocks/mock_context.h"
#include "unit_tests/mocks/mock_device.h"
#include "unit_tests/mocks/mock_execution_environment.h"
#include "unit_tests/mocks/mock_kernel.h"
#include "unit_tests/mocks/mock_mdi.h"
#include "unit_tests/mocks/mock_memory_manager.h"
@@ -197,7 +198,8 @@ TEST_F(TimestampPacketSimpleTests, givenImplicitDependencyWhenEndTagIsWrittenThe
}
TEST_F(TimestampPacketSimpleTests, whenNewTagIsTakenThenReinitialize) {
MockMemoryManager memoryManager;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockMemoryManager memoryManager(executionEnvironment);
MockTagAllocator<TimestampPacket> allocator(&memoryManager, 1);
auto firstNode = allocator.getTag();
@@ -238,7 +240,8 @@ TEST_F(TimestampPacketSimpleTests, whenObjectIsCreatedThenInitializeAllStamps) {
}
TEST_F(TimestampPacketSimpleTests, whenAskedForStampAddressThenReturnWithValidOffset) {
MockMemoryManager memoryManager;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockMemoryManager memoryManager(executionEnvironment);
MockTagAllocator<TimestampPacket> allocator(&memoryManager, 1);
auto node = allocator.getTag();

View File

@@ -8,6 +8,7 @@
#include "runtime/helpers/properties_helper.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/mocks/mock_buffer.h"
#include "unit_tests/mocks/mock_execution_environment.h"
#include "unit_tests/mocks/mock_memory_manager.h"
#include "gtest/gtest.h"
@@ -24,7 +25,7 @@ TEST(TransferPropertiesTest, givenTransferPropertiesCreatedWhenDefaultDebugSetti
}
TEST(TransferPropertiesTest, givenAllocationInNonSystemPoolWhenTransferPropertiesAreCreatedForMapBufferThenLockPtrIsSet) {
ExecutionEnvironment executionEnvironment;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, true, executionEnvironment);
MockContext ctx;
@@ -41,7 +42,7 @@ TEST(TransferPropertiesTest, givenAllocationInNonSystemPoolWhenTransferPropertie
}
TEST(TransferPropertiesTest, givenAllocationInSystemPoolWhenTransferPropertiesAreCreatedForMapBufferThenLockPtrIsNotSet) {
ExecutionEnvironment executionEnvironment;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, true, executionEnvironment);
MockContext ctx;
@@ -67,7 +68,7 @@ TEST(TransferPropertiesTest, givenTransferPropertiesCreatedWhenMemoryManagerInMe
}
TEST(TransferPropertiesTest, givenTransferPropertiesWhenLockedPtrIsSetThenItIsReturnedForReadWrite) {
ExecutionEnvironment executionEnvironment;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, true, executionEnvironment);
MockContext ctx;