test: correct dead code in tests

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2024-05-28 15:01:51 +00:00 committed by Compute-Runtime-Automation
parent 5bbfce8b97
commit 4f8ec54e1d
7 changed files with 19 additions and 23 deletions

View File

@ -288,8 +288,6 @@ TEST(CommandQueue, givenDeviceWhenCreatingCommandQueueThenPickCsrFromDefaultEngi
EXPECT_EQ(defaultCsr, &cmdQ.getGpgpuCommandStreamReceiver());
}
struct CommandQueueWithBlitOperationsTests : public ::testing::TestWithParam<uint32_t> {};
TEST(CommandQueue, givenDeviceNotSupportingBlitOperationsWhenQueueIsCreatedThenDontRegisterAnyBcsCsrs) {
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.blitterOperationsSupported = false;
@ -351,16 +349,6 @@ TEST(CommandQueue, whenCommandQueueWithInternalUsageIsCreatedThenInternalBcsEngi
}
}
INSTANTIATE_TEST_SUITE_P(uint32_t,
CommandQueueWithBlitOperationsTests,
::testing::Values(CL_COMMAND_WRITE_BUFFER,
CL_COMMAND_WRITE_BUFFER_RECT,
CL_COMMAND_READ_BUFFER,
CL_COMMAND_READ_BUFFER_RECT,
CL_COMMAND_COPY_BUFFER,
CL_COMMAND_COPY_BUFFER_RECT,
CL_COMMAND_SVM_MEMCPY));
TEST(CommandQueue, givenCmdQueueBlockedByReadyVirtualEventWhenUnblockingThenUpdateFlushTaskFromEvent) {
auto mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto context = new MockContext;

View File

@ -246,6 +246,11 @@ INSTANTIATE_TEST_SUITE_P(
CreateImageSize,
testing::ValuesIn(allImageTypes));
INSTANTIATE_TEST_SUITE_P(
,
CheckImageType,
testing::ValuesIn(allImageTypes));
static cl_mem_object_type allImageTypesWithBadOne[] = {
0, // negative scenario
CL_MEM_OBJECT_BUFFER,

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Intel Corporation
* Copyright (C) 2022-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -45,4 +45,3 @@ struct ProductConfigHwInfoTests : public ProductConfigTest<::testing::TestWithPa
};
using ProductConfigTests = ProductConfigTest<::testing::Test>;
using ProductConfigHwInfoBadArchTests = ProductConfigHwInfoTests;

View File

@ -180,6 +180,9 @@ TEST_P(ComputeTotalElementsCount, givenVariousInputVectorsWhenComputeTotalElemen
Vec3<size_t> inputData(GetParam().x, GetParam().y, GetParam().z);
EXPECT_EQ(GetParam().result, computeTotalElementsCount(inputData));
}
INSTANTIATE_TEST_SUITE_P(,
ComputeTotalElementsCount,
::testing::ValuesIn(elementCountInputData));
TEST(isPow2Test, WhenArgZeroThenReturnFalse) {
EXPECT_FALSE(isPow2(0u));

View File

@ -479,7 +479,7 @@ INSTANTIATE_TEST_SUITE_P(
HeapIndex::heapStandard2MB,
HeapIndex::heapExtended));
struct GfxPartitionOn57bTest : public ::testing::TestWithParam<uint32_t> {
struct GfxPartitionOn57bTest : public ::testing::Test {
public:
class MockOsMemory : public OSMemory {
public:
@ -599,12 +599,12 @@ struct GfxPartitionOn57bTest : public ::testing::TestWithParam<uint32_t> {
uint32_t GfxPartitionOn57bTest::MockOsMemory::reserveCount = 0;
TEST_P(GfxPartitionOn57bTest, given48bitCpuAddressWidthWhenInitializingGfxPartitionThenDoNotReserve48bitSpaceForDriverAllocations) {
TEST_F(GfxPartitionOn57bTest, given48bitCpuAddressWidthWhenInitializingGfxPartitionThenDoNotReserve48bitSpaceForDriverAllocations) {
if (is32bit) {
GTEST_SKIP();
}
auto gpuAddressSpace = GetParam();
auto gpuAddressSpace = 48;
// 48 bit CPU VA - do not reserve CPU address range, use [0x800000000000-0xFFFFFFFFFFFF]
CpuInfoOverrideVirtualAddressSizeAndFlags overrideCpuInfo(48);
@ -618,12 +618,12 @@ TEST_P(GfxPartitionOn57bTest, given48bitCpuAddressWidthWhenInitializingGfxPartit
verifyHeaps(0x800000000000, 0x1000000000000, 0x7FFFFFFFFFFF, gpuAddressSpace == 57);
}
TEST_P(GfxPartitionOn57bTest, given57bitCpuAddressWidthAndLa57IsNotPresentWhenInitializingGfxPartitionThenDoNotReserve48bitSpaceForDriverAllocations) {
TEST_F(GfxPartitionOn57bTest, given57bitCpuAddressWidthAndLa57IsNotPresentWhenInitializingGfxPartitionThenDoNotReserve48bitSpaceForDriverAllocations) {
if (is32bit) {
GTEST_SKIP();
}
auto gpuAddressSpace = GetParam();
auto gpuAddressSpace = 57;
// 57 bit CPU VA, la57 is not present - do not reserve CPU address range, use [0x800000000000-0xFFFFFFFFFFFF]
CpuInfoOverrideVirtualAddressSizeAndFlags overrideCpuInfo(57);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -10,7 +10,7 @@
#include "shared/source/memory_manager/local_memory_usage.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "third_party/gtest/gtest/gtest.h"
#include "gtest/gtest.h"
namespace NEO {

View File

@ -1,10 +1,11 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/file_io.h"
#include "shared/source/os_interface/linux/os_inc.h"
@ -115,7 +116,7 @@ TEST(OSMemoryLinux, GivenProcSelfMapsFileExistsWhenGetMemoryMapsIsQueriedThenVal
{0x564fcd1fa000, 0x564fcd202000}, {0x564fcd401000, 0x564fcd402000}, {0x564fcd402000, 0x564fcd403000}, {0x564fcdf40000, 0x564fcdf61000}, {0x7fded3d79000, 0x7fded4879000}, {0x7fded4879000, 0x7fded4a60000}, {0x7fded4a60000, 0x7fded4c60000}, {0x7fded4c60000, 0x7fded4c64000}, {0x7fded4c64000, 0x7fded4c66000}, {0x7fded4c66000, 0x7fded4c6a000}, {0x7fded4c6a000, 0x7fded4c91000}, {0x7fded4e54000, 0x7fded4e78000}, {0x7fded4e91000, 0x7fded4e92000}, {0x7fded4e92000, 0x7fded4e93000}, {0x7fded4e93000, 0x7fded4e94000}, {0x7ffd6dfa2000, 0x7ffd6dfc3000}, {0x7ffd6dfe8000, 0x7ffd6dfeb000}, {0x7ffd6dfeb000, 0x7ffd6dfec000}, {0xffffffffff600000, 0xffffffffff601000}};
EXPECT_FALSE(memoryMaps.empty());
EXPECT_EQ(memoryMaps.size(), GTEST_ARRAY_SIZE_(referenceMaps));
EXPECT_EQ(memoryMaps.size(), arrayCount(referenceMaps));
for (size_t i = 0; i < memoryMaps.size(); ++i) {
EXPECT_EQ(memoryMaps[i].start, referenceMaps[i].start);