Skip to content

Commit f5cd218

Browse files
Change Test to HWTEST_F
Change-Id: I2de6a9d4e812d58c77d8b60bdf71b34402d35619 Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent dad23e2 commit f5cd218

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

opencl/test/unit_test/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ class MemoryManagerGetAlloctionDataTest : public testing::TestWithParam<Graphics
2525
void TearDown() override {}
2626
};
2727

28-
TEST(MemoryManagerGetAlloctionDataTest, givenHostMemoryAllocationTypeAndAllocateMemoryFlagAndNullptrWhenAllocationDataIsQueriedThenCorrectFlagsAndSizeAreSet) {
28+
using MemoryManagerGetAlloctionDataTests = ::testing::Test;
29+
30+
TEST_F(MemoryManagerGetAlloctionDataTests, givenHostMemoryAllocationTypeAndAllocateMemoryFlagAndNullptrWhenAllocationDataIsQueriedThenCorrectFlagsAndSizeAreSet) {
2931
AllocationData allocData;
3032
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {});
3133
MockMemoryManager mockMemoryManager;
@@ -36,7 +38,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenHostMemoryAllocationTypeAndAllocate
3638
EXPECT_EQ(nullptr, allocData.hostPtr);
3739
}
3840

39-
TEST(MemoryManagerGetAlloctionDataTest, givenNonHostMemoryAllocatoinTypeWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsNotSet) {
41+
TEST_F(MemoryManagerGetAlloctionDataTests, givenNonHostMemoryAllocatoinTypeWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsNotSet) {
4042
AllocationData allocData;
4143
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, {});
4244

@@ -48,7 +50,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenNonHostMemoryAllocatoinTypeWhenAllo
4850
EXPECT_EQ(nullptr, allocData.hostPtr);
4951
}
5052

51-
TEST(MemoryManagerGetAlloctionDataTest, givenCommandBufferAllocationTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
53+
HWTEST_F(MemoryManagerGetAlloctionDataTests, givenCommandBufferAllocationTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
5254
AllocationData allocData;
5355
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::COMMAND_BUFFER, false, {});
5456

@@ -58,7 +60,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenCommandBufferAllocationTypeWhenGetA
5860
EXPECT_TRUE(allocData.flags.useSystemMemory);
5961
}
6062

61-
TEST(MemoryManagerGetAlloctionDataTest, givenAllocateMemoryFlagTrueWhenHostPtrIsNotNullThenAllocationDataHasHostPtrNulled) {
63+
TEST_F(MemoryManagerGetAlloctionDataTests, givenAllocateMemoryFlagTrueWhenHostPtrIsNotNullThenAllocationDataHasHostPtrNulled) {
6264
AllocationData allocData;
6365
char memory = 0;
6466
AllocationProperties properties(0, true, sizeof(memory), GraphicsAllocation::AllocationType::BUFFER, false, {});
@@ -70,7 +72,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenAllocateMemoryFlagTrueWhenHostPtrIs
7072
EXPECT_EQ(nullptr, allocData.hostPtr);
7173
}
7274

73-
TEST(MemoryManagerGetAlloctionDataTest, givenBufferTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
75+
TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
7476
AllocationData allocData;
7577
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, {});
7678

@@ -80,7 +82,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenBufferTypeWhenAllocationDataIsQueri
8082
EXPECT_TRUE(allocData.flags.forcePin);
8183
}
8284

83-
TEST(MemoryManagerGetAlloctionDataTest, givenBufferHostMemoryTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
85+
TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferHostMemoryTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
8486
AllocationData allocData;
8587
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, false, {});
8688

@@ -90,7 +92,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenBufferHostMemoryTypeWhenAllocationD
9092
EXPECT_TRUE(allocData.flags.forcePin);
9193
}
9294

93-
TEST(MemoryManagerGetAlloctionDataTest, givenBufferCompressedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
95+
TEST_F(MemoryManagerGetAlloctionDataTests, givenBufferCompressedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
9496
AllocationData allocData;
9597
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, false, {});
9698

@@ -100,7 +102,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenBufferCompressedTypeWhenAllocationD
100102
EXPECT_TRUE(allocData.flags.forcePin);
101103
}
102104

103-
TEST(MemoryManagerGetAlloctionDataTest, givenWriteCombinedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
105+
TEST_F(MemoryManagerGetAlloctionDataTests, givenWriteCombinedTypeWhenAllocationDataIsQueriedThenForcePinFlagIsSet) {
104106
AllocationData allocData;
105107
AllocationProperties properties(0, true, 10, GraphicsAllocation::AllocationType::WRITE_COMBINED, false, {});
106108

@@ -110,7 +112,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenWriteCombinedTypeWhenAllocationData
110112
EXPECT_TRUE(allocData.flags.forcePin);
111113
}
112114

113-
TEST(MemoryManagerGetAlloctionDataTest, givenDefaultAllocationFlagsWhenAllocationDataIsQueriedThenAllocateMemoryIsFalse) {
115+
TEST_F(MemoryManagerGetAlloctionDataTests, givenDefaultAllocationFlagsWhenAllocationDataIsQueriedThenAllocateMemoryIsFalse) {
114116
AllocationData allocData;
115117
AllocationProperties properties(0, false, 0, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, false, {});
116118
char memory;
@@ -120,7 +122,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenDefaultAllocationFlagsWhenAllocatio
120122
EXPECT_FALSE(allocData.flags.allocateMemory);
121123
}
122124

123-
TEST(MemoryManagerGetAlloctionDataTest, givenDebugModeWhenCertainAllocationTypesAreSelectedThenSystemPlacementIsChoosen) {
125+
TEST_F(MemoryManagerGetAlloctionDataTests, givenDebugModeWhenCertainAllocationTypesAreSelectedThenSystemPlacementIsChoosen) {
124126
DebugManagerStateRestore restorer;
125127
auto allocationType = GraphicsAllocation::AllocationType::BUFFER;
126128
auto mask = 1llu << (static_cast<int64_t>(allocationType) - 1);

0 commit comments

Comments
 (0)