mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
ULTs cleanup
- remove unused MemoryManagementFixture. MemoryLeaks are tracked using MemoryLeakListener no need to duplicate with Fixure. MMF should be used when you need to inject memory allocation failure Change-Id: I95bcaa7051acf540c5b015c5489ed6a6fc38ee8e
This commit is contained in:
committed by
sys_ocldev
parent
9e509f302a
commit
7e6432a207
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -23,7 +23,6 @@
|
||||
#pragma once
|
||||
#include "gtest/gtest.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "gen_cmd_parse.h"
|
||||
#include "unit_tests/command_queue/command_enqueue_fixture.h"
|
||||
#include "unit_tests/fixtures/buffer_fixture.h"
|
||||
@@ -65,7 +64,6 @@ struct EnqueueCopyBufferRectHelper {
|
||||
|
||||
struct EnqueueCopyBufferRectTest : public CommandEnqueueFixture,
|
||||
public EnqueueCopyBufferRectHelper,
|
||||
public MemoryManagementFixture,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueCopyBufferRectTest(void) : srcBuffer(nullptr),
|
||||
@@ -77,7 +75,6 @@ struct EnqueueCopyBufferRectTest : public CommandEnqueueFixture,
|
||||
};
|
||||
|
||||
virtual void SetUp(void) override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
CommandEnqueueFixture::SetUp();
|
||||
BufferDefaults::context = new MockContext;
|
||||
|
||||
@@ -90,7 +87,6 @@ struct EnqueueCopyBufferRectTest : public CommandEnqueueFixture,
|
||||
delete dstBuffer;
|
||||
delete BufferDefaults::context;
|
||||
CommandEnqueueFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "runtime/sampler/sampler.h"
|
||||
#include "unit_tests/fixtures/buffer_fixture.h"
|
||||
#include "unit_tests/fixtures/image_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/mocks/mock_buffer.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "runtime/api/api.h"
|
||||
@@ -59,15 +58,7 @@ struct ObjectForTest2 : public OCLRT::BaseObject<_cl_object_for_test2> {
|
||||
};
|
||||
|
||||
template <typename TypeParam>
|
||||
struct BaseObjectTests : public MemoryManagementFixture,
|
||||
public ::testing::Test {
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
struct BaseObjectTests : public ::testing::Test {
|
||||
};
|
||||
|
||||
template <typename BaseType>
|
||||
@@ -161,7 +152,7 @@ TYPED_TEST(BaseObjectTests, retain) {
|
||||
|
||||
object->release();
|
||||
|
||||
// MemoryManagementFixture will detect a leak
|
||||
// MemoryLeakListener will detect a leak
|
||||
// if release doesn't delete memory.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -23,21 +23,12 @@
|
||||
#include "runtime/command_queue/command_queue.h"
|
||||
#include "runtime/platform/platform.h"
|
||||
#include "runtime/accelerators/intel_accelerator.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
template <typename TypeParam>
|
||||
struct BaseObjectTestsMt : public MemoryManagementFixture,
|
||||
public ::testing::Test {
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
struct BaseObjectTestsMt : public ::testing::Test {
|
||||
static void takeOwnerFailThreadFunc(TypeParam *obj) {
|
||||
auto ret = obj->takeOwnership(false);
|
||||
EXPECT_EQ(false, ret);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "unit_tests/fixtures/context_fixture.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
#include "unit_tests/mocks/mock_buffer.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "test.h"
|
||||
|
||||
@@ -32,7 +31,7 @@ namespace OCLRT {
|
||||
|
||||
using namespace SplitDispatch;
|
||||
|
||||
class DispatchInfoBuilderFixture : public ContextFixture, public DeviceFixture, public MemoryManagementFixture {
|
||||
class DispatchInfoBuilderFixture : public ContextFixture, public DeviceFixture {
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
public:
|
||||
@@ -42,8 +41,7 @@ class DispatchInfoBuilderFixture : public ContextFixture, public DeviceFixture,
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
DeviceFixture::SetUp();
|
||||
cl_device_id device = pDevice;
|
||||
ContextFixture::SetUp(1, &device);
|
||||
@@ -102,7 +100,6 @@ class DispatchInfoBuilderFixture : public ContextFixture, public DeviceFixture,
|
||||
|
||||
ContextFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
KernelInfo *pKernelInfo = nullptr;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
#include "unit_tests/fixtures/context_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/image_fixture.h"
|
||||
#include <type_traits>
|
||||
@@ -33,15 +32,14 @@
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
class DispatchInfoFixture : public ContextFixture, public DeviceFixture, public MemoryManagementFixture {
|
||||
class DispatchInfoFixture : public ContextFixture, public DeviceFixture {
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
public:
|
||||
DispatchInfoFixture() {}
|
||||
|
||||
protected:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
DeviceFixture::SetUp();
|
||||
cl_device_id device = pDevice;
|
||||
ContextFixture::SetUp(1, &device);
|
||||
@@ -67,7 +65,6 @@ class DispatchInfoFixture : public ContextFixture, public DeviceFixture, public
|
||||
|
||||
ContextFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
KernelInfo *pKernelInfo = nullptr;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "runtime/memory_manager/svm_memory_manager.h"
|
||||
#include "unit_tests/fixtures/context_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/fixtures/image_fixture.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/mocks/mock_sampler.h"
|
||||
@@ -45,7 +44,7 @@
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
class CloneKernelFixture : public ContextFixture, public DeviceFixture, public MemoryManagementFixture {
|
||||
class CloneKernelFixture : public ContextFixture, public DeviceFixture {
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
public:
|
||||
@@ -53,8 +52,7 @@ class CloneKernelFixture : public ContextFixture, public DeviceFixture, public M
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
DeviceFixture::SetUp();
|
||||
cl_device_id device = pDevice;
|
||||
ContextFixture::SetUp(1, &device);
|
||||
@@ -117,7 +115,6 @@ class CloneKernelFixture : public ContextFixture, public DeviceFixture, public M
|
||||
delete pProgram;
|
||||
ContextFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "unit_tests/fixtures/context_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/mocks/mock_buffer.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
@@ -40,7 +39,6 @@
|
||||
using namespace OCLRT;
|
||||
|
||||
void KernelArgBufferFixture::SetUp() {
|
||||
MemoryManagementFixture::SetUp();
|
||||
DeviceFixture::SetUp();
|
||||
cl_device_id device = pDevice;
|
||||
ContextFixture::SetUp(1, &device);
|
||||
@@ -78,5 +76,4 @@ void KernelArgBufferFixture::TearDown() {
|
||||
delete pProgram;
|
||||
ContextFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "unit_tests/fixtures/context_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/mocks/mock_buffer.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
@@ -38,7 +37,7 @@
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
class KernelArgBufferFixture : public ContextFixture, public DeviceFixture, public MemoryManagementFixture {
|
||||
class KernelArgBufferFixture : public ContextFixture, public DeviceFixture {
|
||||
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
@@ -48,8 +47,8 @@ class KernelArgBufferFixture : public ContextFixture, public DeviceFixture, publ
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
void SetUp();
|
||||
void TearDown();
|
||||
|
||||
cl_int retVal;
|
||||
MockProgram *pProgram;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "unit_tests/fixtures/context_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/mocks/mock_buffer.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
@@ -38,7 +37,7 @@
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
class KernelArgSvmFixture_ : public ContextFixture, public DeviceFixture, public MemoryManagementFixture {
|
||||
class KernelArgSvmFixture_ : public ContextFixture, public DeviceFixture {
|
||||
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
@@ -47,8 +46,7 @@ class KernelArgSvmFixture_ : public ContextFixture, public DeviceFixture, public
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
DeviceFixture::SetUp();
|
||||
cl_device_id device = pDevice;
|
||||
ContextFixture::SetUp(1, &device);
|
||||
@@ -84,7 +82,6 @@ class KernelArgSvmFixture_ : public ContextFixture, public DeviceFixture, public
|
||||
delete pProgram;
|
||||
ContextFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
|
||||
@@ -286,16 +286,13 @@ INSTANTIATE_TEST_CASE_P(KernelTests,
|
||||
::testing::ValuesIn(BinaryFileNames),
|
||||
::testing::ValuesIn(KernelNames)));
|
||||
|
||||
class KernelFromBinaryTest : public ProgramSimpleFixture,
|
||||
public MemoryManagementFixture {
|
||||
class KernelFromBinaryTest : public ProgramSimpleFixture {
|
||||
public:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
ProgramSimpleFixture::SetUp();
|
||||
}
|
||||
void TearDown() override {
|
||||
ProgramSimpleFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
};
|
||||
typedef Test<KernelFromBinaryTest> KernelFromBinaryTests;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -23,8 +23,6 @@
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/helpers/memory_management.h"
|
||||
#include "unit_tests/mocks/mock_buffer.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
#include "gtest/gtest.h"
|
||||
@@ -36,7 +34,6 @@ namespace ULT {
|
||||
static const unsigned int sizeTestBufferInBytes = 32;
|
||||
|
||||
class SubBufferTest : public DeviceFixture,
|
||||
public MemoryManagementFixture,
|
||||
public ::testing::Test {
|
||||
public:
|
||||
SubBufferTest() {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "runtime/os_interface/device_factory.h"
|
||||
#include "runtime/os_interface/os_library.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@@ -33,17 +32,14 @@ using namespace OCLRT;
|
||||
|
||||
OsLibrary *setAdapterInfo(const PLATFORM *platform, const GT_SYSTEM_INFO *gtSystemInfo);
|
||||
|
||||
struct DeviceFactoryTest : public MemoryManagementFixture,
|
||||
public ::testing::Test {
|
||||
struct DeviceFactoryTest : public ::testing::Test {
|
||||
public:
|
||||
void SetUp() override {
|
||||
const HardwareInfo hwInfo = *platformDevices[0];
|
||||
mockGdiDll = setAdapterInfo(hwInfo.pPlatform, hwInfo.pSysInfo);
|
||||
MemoryManagementFixture::SetUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
MemoryManagementFixture::TearDown();
|
||||
delete mockGdiDll;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,28 +30,13 @@
|
||||
#include "runtime/os_interface/linux/drm_command_stream.h"
|
||||
#include "hw_cmds.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "test.h"
|
||||
|
||||
#include "unit_tests/os_interface/linux/device_command_stream_fixture.h"
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
class DeviceCommandStreamLeaksFixture : public DeviceFixture,
|
||||
public MemoryManagementFixture {
|
||||
public:
|
||||
void SetUp() override {
|
||||
DeviceFixture::SetUp();
|
||||
MemoryManagementFixture::SetUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
MemoryManagementFixture::TearDown();
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
typedef Test<DeviceCommandStreamLeaksFixture> DeviceCommandStreamLeaksTest;
|
||||
typedef Test<DeviceFixture> DeviceCommandStreamLeaksTest;
|
||||
|
||||
HWTEST_F(DeviceCommandStreamLeaksTest, Create) {
|
||||
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], false));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "runtime/os_interface/device_factory.h"
|
||||
#include "unit_tests/mocks/mock_device_factory.h"
|
||||
#include "unit_tests/os_interface/linux/drm_mock.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/gen_common/test.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@@ -38,11 +37,8 @@ void popDrmMock();
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
struct DeviceFactoryLinuxTest : public MemoryManagementFixture,
|
||||
public ::testing::Test {
|
||||
struct DeviceFactoryLinuxTest : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
|
||||
pDrm = new Drm2;
|
||||
pDrm->setGtType(GTTYPE_GT2);
|
||||
pushDrmMock(pDrm);
|
||||
@@ -51,8 +47,6 @@ struct DeviceFactoryLinuxTest : public MemoryManagementFixture,
|
||||
void TearDown() override {
|
||||
popDrmMock();
|
||||
delete pDrm;
|
||||
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
Drm2 *pDrm;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "runtime/os_interface/32bit_memory.h"
|
||||
#include "runtime/os_interface/linux/drm_buffer_object.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/os_interface/linux/device_command_stream_fixture.h"
|
||||
#include "drm/i915_drm.h"
|
||||
#include "test.h"
|
||||
@@ -48,14 +47,13 @@ class TestedBufferObject : public BufferObject {
|
||||
drm_i915_gem_exec_object2 *execObjectPointerFilled = nullptr;
|
||||
};
|
||||
|
||||
class DrmBufferObjectFixture : public MemoryManagementFixture {
|
||||
class DrmBufferObjectFixture {
|
||||
public:
|
||||
DrmMockCustom *mock;
|
||||
TestedBufferObject *bo;
|
||||
drm_i915_gem_exec_object2 execObjectsStorage[256];
|
||||
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
this->mock = new DrmMockCustom;
|
||||
ASSERT_NE(nullptr, this->mock);
|
||||
bo = new TestedBufferObject(this->mock);
|
||||
@@ -63,7 +61,7 @@ class DrmBufferObjectFixture : public MemoryManagementFixture {
|
||||
bo->setExecObjectsStorage(execObjectsStorage);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
void TearDown() {
|
||||
delete bo;
|
||||
if (this->mock->ioctl_expected.total >= 0) {
|
||||
EXPECT_EQ(this->mock->ioctl_expected.total, this->mock->ioctl_cnt.total);
|
||||
@@ -71,7 +69,6 @@ class DrmBufferObjectFixture : public MemoryManagementFixture {
|
||||
|
||||
delete this->mock;
|
||||
this->mock = nullptr;
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,10 +32,8 @@
|
||||
#include "runtime/os_interface/linux/drm_command_stream.h"
|
||||
#include "runtime/os_interface/linux/drm_memory_manager.h"
|
||||
#include "runtime/os_interface/linux/os_interface.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
||||
#include "unit_tests/helpers/memory_management.h"
|
||||
#include "unit_tests/gen_common/gen_cmd_parse_base.h"
|
||||
#include "unit_tests/helpers/hw_parse.h"
|
||||
#include "unit_tests/mocks/mock_submissions_aggregator.h"
|
||||
@@ -696,7 +694,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedDefaul
|
||||
/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
|
||||
* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ****
|
||||
* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
|
||||
class DrmCommandStreamEnhancedFixture : public MemoryManagementFixture
|
||||
class DrmCommandStreamEnhancedFixture
|
||||
|
||||
{
|
||||
public:
|
||||
@@ -705,8 +703,7 @@ class DrmCommandStreamEnhancedFixture : public MemoryManagementFixture
|
||||
DrmMemoryManager *mm = nullptr;
|
||||
DebugManagerStateRestore *dbgState;
|
||||
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
|
||||
this->dbgState = new DebugManagerStateRestore();
|
||||
//make sure this is disabled, we don't want test this now
|
||||
@@ -720,14 +717,12 @@ class DrmCommandStreamEnhancedFixture : public MemoryManagementFixture
|
||||
ASSERT_NE(nullptr, mm);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
void TearDown() {
|
||||
//And close at destruction
|
||||
delete csr;
|
||||
delete mm;
|
||||
delete mock;
|
||||
delete dbgState;
|
||||
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
bool isResident(BufferObject *bo) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -36,8 +36,6 @@
|
||||
#include "runtime/os_interface/linux/drm_command_stream.h"
|
||||
#include "runtime/os_interface/linux/drm_gem_close_worker.h"
|
||||
#include "runtime/os_interface/linux/drm_memory_manager.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/helpers/memory_management.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/os_interface/linux/device_command_stream_fixture.h"
|
||||
|
||||
@@ -66,7 +64,7 @@ class DrmMockForWorker : public Drm {
|
||||
};
|
||||
};
|
||||
|
||||
class DrmGemCloseWorkerFixture : public MemoryManagementFixture {
|
||||
class DrmGemCloseWorkerFixture {
|
||||
public:
|
||||
//max loop count for while
|
||||
static const uint32_t deadCntInit = 10 * 1000 * 1000;
|
||||
@@ -75,8 +73,7 @@ class DrmGemCloseWorkerFixture : public MemoryManagementFixture {
|
||||
DrmMockForWorker *drmMock;
|
||||
uint32_t deadCnt = deadCntInit;
|
||||
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
void SetUp() {
|
||||
this->drmMock = new DrmMockForWorker;
|
||||
|
||||
this->drmMock->gem_close_cnt = 0;
|
||||
@@ -85,7 +82,7 @@ class DrmGemCloseWorkerFixture : public MemoryManagementFixture {
|
||||
this->mm = new DrmMemoryManager(this->drmMock, gemCloseWorkerMode::gemCloseWorkerConsumingCommandBuffers, false, false);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
void TearDown() {
|
||||
if (this->drmMock->gem_close_expected >= 0) {
|
||||
EXPECT_EQ(this->drmMock->gem_close_expected, this->drmMock->gem_close_cnt);
|
||||
}
|
||||
@@ -93,7 +90,6 @@ class DrmGemCloseWorkerFixture : public MemoryManagementFixture {
|
||||
delete this->mm;
|
||||
delete this->drmMock;
|
||||
this->drmMock = nullptr;
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -103,7 +103,6 @@ TEST_F(OSLibraryTest, testFailNew) {
|
||||
|
||||
// Make sure that we only have 1 buffer allocated at a time
|
||||
delete library;
|
||||
library = nullptr;
|
||||
};
|
||||
injectFailures(method);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ using namespace OCLRT;
|
||||
using namespace ::testing;
|
||||
|
||||
void WddmMemoryManagerFixture::SetUp() {
|
||||
MemoryManagementFixture::SetUp();
|
||||
WddmFixture::SetUp();
|
||||
ASSERT_NE(nullptr, wddm);
|
||||
if (platformDevices[0]->capabilityTable.ftrCompression) {
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include "test.h"
|
||||
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
#include "unit_tests/mocks/mock_gmm_page_table_mngr.h"
|
||||
#include "unit_tests/mocks/mock_gmm.h"
|
||||
@@ -37,7 +36,7 @@
|
||||
using namespace OCLRT;
|
||||
using namespace ::testing;
|
||||
|
||||
class WddmMemoryManagerFixture : public MemoryManagementFixture, public WddmFixture {
|
||||
class WddmMemoryManagerFixture : public WddmFixture {
|
||||
public:
|
||||
WddmMemoryManager *memoryManager = nullptr;
|
||||
|
||||
@@ -63,7 +62,6 @@ class WddmMemoryManagerFixture : public MemoryManagementFixture, public WddmFixt
|
||||
delete memoryManager;
|
||||
this->wddm = nullptr;
|
||||
WddmFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1310,16 +1310,13 @@ TEST_P(ProgramFromSourceTest, CreateWithSource_CreateLibrary) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Program:: (PatchToken)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class PatchTokenFromBinaryTest : public ProgramSimpleFixture,
|
||||
public MemoryManagementFixture {
|
||||
class PatchTokenFromBinaryTest : public ProgramSimpleFixture {
|
||||
public:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
ProgramSimpleFixture::SetUp();
|
||||
}
|
||||
void TearDown() override {
|
||||
ProgramSimpleFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
};
|
||||
typedef Test<PatchTokenFromBinaryTest> PatchTokenTests;
|
||||
@@ -1548,16 +1545,13 @@ TEST_F(PatchTokenTests, VmeKernelArg) {
|
||||
delete pKernel;
|
||||
}
|
||||
|
||||
class ProgramPatchTokenFromBinaryTest : public ProgramSimpleFixture,
|
||||
public MemoryManagementFixture {
|
||||
class ProgramPatchTokenFromBinaryTest : public ProgramSimpleFixture {
|
||||
public:
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
ProgramSimpleFixture::SetUp();
|
||||
}
|
||||
void TearDown() override {
|
||||
ProgramSimpleFixture::TearDown();
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
};
|
||||
typedef Test<ProgramPatchTokenFromBinaryTest> ProgramPatchTokenTests;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -23,38 +23,31 @@
|
||||
#include "runtime/sampler/sampler.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
#include "unit_tests/mocks/mock_sampler.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/fixtures/memory_management_fixture.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "patch_list.h"
|
||||
#include <tuple>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
struct CreateSampler : public MemoryManagementFixture,
|
||||
public ::testing::TestWithParam<
|
||||
struct CreateSampler : public ::testing::TestWithParam<
|
||||
std::tuple<uint32_t /*cl_bool*/, uint32_t /*cl_addressing_mode*/, uint32_t /*cl_filter_mode*/>> {
|
||||
CreateSampler() {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
std::tie(normalizedCoords, addressingMode, filterMode) = GetParam();
|
||||
context = new MockContext();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
delete context;
|
||||
MemoryManagementFixture::TearDown();
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
MockContext * context;
|
||||
MockContext *context;
|
||||
cl_int retVal = CL_INVALID_VALUE;
|
||||
cl_bool normalizedCoords;
|
||||
cl_addressing_mode addressingMode;
|
||||
cl_filter_mode filterMode;
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
TEST_P(CreateSampler, shouldReturnSuccess) {
|
||||
@@ -77,12 +70,10 @@ TEST_P(CreateSampler, shouldPropagateSamplerState) {
|
||||
filterMode);
|
||||
ASSERT_NE(nullptr, sampler);
|
||||
|
||||
// clang-format off
|
||||
EXPECT_EQ(context, sampler->getContext());
|
||||
EXPECT_EQ(normalizedCoords, sampler->getNormalizedCoordinates());
|
||||
EXPECT_EQ(addressingMode, sampler->getAddressingMode());
|
||||
EXPECT_EQ(filterMode, sampler->getFilterMode());
|
||||
// clang-format on
|
||||
|
||||
//check for SnapWA
|
||||
bool snapWaNeeded = addressingMode == CL_ADDRESS_CLAMP && filterMode == CL_FILTER_NEAREST;
|
||||
|
||||
Reference in New Issue
Block a user