Skip to content

Commit 13f23df

Browse files
committed
Refactor UltCommandStreamReceiverTest test
- remove unnecessary dynamic allocations Change-Id: I2580244c91fd3f6864c55807090823556b4c7906
1 parent 1bf98c7 commit 13f23df

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

unit_tests/command_stream/command_stream_receiver_hw_tests.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, UltCommandStreamReceiverTest, givenNotSentStateSipWh
6868
DispatchFlags dispatchFlags;
6969
dispatchFlags.preemptionMode = PreemptionMode::MidThread;
7070

71-
void *buffer = alignedMalloc(MemoryConstants::pageSize, MemoryConstants::pageSize64k);
72-
73-
std::unique_ptr<MockGraphicsAllocation> allocation(new MockGraphicsAllocation(buffer, MemoryConstants::pageSize));
74-
std::unique_ptr<IndirectHeap> heap(new IndirectHeap(allocation.get()));
71+
MockGraphicsAllocation allocation(nullptr, 0);
72+
IndirectHeap heap(&allocation);
7573

7674
csr.flushTask(commandStream,
7775
0,
78-
*heap.get(),
79-
*heap.get(),
80-
*heap.get(),
76+
heap,
77+
heap,
78+
heap,
8179
0,
8280
dispatchFlags,
8381
*mockDevice);
@@ -89,8 +87,6 @@ HWCMDTEST_F(IGFX_GEN8_CORE, UltCommandStreamReceiverTest, givenNotSentStateSipWh
8987

9088
auto stateSipItor = find<STATE_SIP *>(hwParser.cmdList.begin(), hwParser.cmdList.end());
9189
EXPECT_NE(hwParser.cmdList.end(), stateSipItor);
92-
93-
alignedFree(buffer);
9490
}
9591
}
9692

0 commit comments

Comments
 (0)