Skip to content

Commit b6a9632

Browse files
ULT renaming: CSR tests
Related-To: NEO-2236 Change-Id: I532c096b530d3da0ad11c58809ae9fdb8d82719b Signed-off-by: Adam Cetnerowski <[email protected]>
1 parent b498fea commit b6a9632

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

unit_tests/command_stream/command_stream_receiver_tests.cpp

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ struct CommandStreamReceiverTest : public DeviceFixture,
6060
InternalAllocationStorage *internalAllocationStorage;
6161
};
6262

63-
HWTEST_F(CommandStreamReceiverTest, testCtor) {
63+
HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenDefaultValuesAreSet) {
6464
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
6565
EXPECT_EQ(0u, csr.peekTaskLevel());
6666
EXPECT_EQ(0u, csr.peekTaskCount());
6767
EXPECT_FALSE(csr.isPreambleSent);
6868
}
6969

70-
HWTEST_F(CommandStreamReceiverTest, testInitProgrammingFlags) {
70+
HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenFlagsAreSetCorrectly) {
7171
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
7272
csr.initProgrammingFlags();
7373
EXPECT_FALSE(csr.isPreambleSent);
@@ -81,7 +81,7 @@ HWTEST_F(CommandStreamReceiverTest, testInitProgrammingFlags) {
8181
EXPECT_EQ(0u, csr.latestSentStatelessMocsConfig);
8282
}
8383

84-
TEST_F(CommandStreamReceiverTest, makeResident_setsBufferResidencyFlag) {
84+
TEST_F(CommandStreamReceiverTest, WhenMakingResidentThenBufferResidencyFlagIsSet) {
8585
MockContext context;
8686
float srcMemory[] = {1.0f};
8787

@@ -116,23 +116,23 @@ TEST_F(CommandStreamReceiverTest, givenBaseDownloadAllocationCalledThenDoesNotCh
116116
memoryManager->freeGraphicsMemory(graphicsAllocation);
117117
}
118118

119-
TEST_F(CommandStreamReceiverTest, commandStreamReceiverFromDeviceHasATagValue) {
119+
TEST_F(CommandStreamReceiverTest, WhenCommandStreamReceiverIsCreatedThenItHasATagValue) {
120120
EXPECT_NE(nullptr, const_cast<uint32_t *>(commandStreamReceiver->getTagAddress()));
121121
}
122122

123-
TEST_F(CommandStreamReceiverTest, GetCommandStreamReturnsValidObject) {
123+
TEST_F(CommandStreamReceiverTest, WhenGettingCommandStreamerThenValidPointerIsReturned) {
124124
auto &cs = commandStreamReceiver->getCS();
125125
EXPECT_NE(nullptr, &cs);
126126
}
127127

128-
TEST_F(CommandStreamReceiverTest, getCommandStreamContainsMemoryForRequest) {
128+
TEST_F(CommandStreamReceiverTest, WhenCommandStreamReceiverIsCreatedThenAvailableMemoryIsGreaterOrEqualRequiredSize) {
129129
size_t requiredSize = 16384;
130130
const auto &commandStream = commandStreamReceiver->getCS(requiredSize);
131131
ASSERT_NE(nullptr, &commandStream);
132132
EXPECT_GE(commandStream.getAvailableSpace(), requiredSize);
133133
}
134134

135-
TEST_F(CommandStreamReceiverTest, getCsReturnsCsWithCsOverfetchSizeIncludedInGraphicsAllocation) {
135+
TEST_F(CommandStreamReceiverTest, WhenCommandStreamReceiverIsCreatedThenCsOverfetchSizeIsIncludedInGraphicsAllocation) {
136136
size_t sizeRequested = 560;
137137
const auto &commandStream = commandStreamReceiver->getCS(sizeRequested);
138138
ASSERT_NE(nullptr, &commandStream);
@@ -146,7 +146,7 @@ TEST_F(CommandStreamReceiverTest, getCsReturnsCsWithCsOverfetchSizeIncludedInGra
146146
EXPECT_EQ(expectedTotalSize, allocation->getUnderlyingBufferSize());
147147
}
148148

149-
TEST_F(CommandStreamReceiverTest, getCommandStreamCanRecycle) {
149+
TEST_F(CommandStreamReceiverTest, WhenRequestingAdditionalSpaceThenCsrGetsAdditionalSpace) {
150150
auto &commandStreamInitial = commandStreamReceiver->getCS();
151151
size_t requiredSize = commandStreamInitial.getMaxAvailableSpace() + 42;
152152

@@ -182,7 +182,7 @@ HWTEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenCheckedForInit
182182
EXPECT_EQ(CacheSettings::unknownMocs, csr.latestSentStatelessMocsConfig);
183183
}
184184

185-
TEST_F(CommandStreamReceiverTest, makeResidentPushesAllocationToMemoryManagerResidencyList) {
185+
TEST_F(CommandStreamReceiverTest, WhenMakingResidentThenAllocationIsPushedToMemoryManagerResidencyList) {
186186
auto *memoryManager = commandStreamReceiver->getMemoryManager();
187187

188188
GraphicsAllocation *graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
@@ -199,7 +199,7 @@ TEST_F(CommandStreamReceiverTest, makeResidentPushesAllocationToMemoryManagerRes
199199
memoryManager->freeGraphicsMemory(graphicsAllocation);
200200
}
201201

202-
TEST_F(CommandStreamReceiverTest, makeResidentWithoutParametersDoesNothing) {
202+
TEST_F(CommandStreamReceiverTest, GivenNoParamatersWhenMakingResidentThenResidencyDoesNotOccur) {
203203
commandStreamReceiver->processResidency(commandStreamReceiver->getResidencyAllocations());
204204
auto &residencyAllocations = commandStreamReceiver->getResidencyAllocations();
205205
EXPECT_EQ(0u, residencyAllocations.size());
@@ -243,7 +243,7 @@ HWTEST_F(CommandStreamReceiverTest, givenCsrWhenAllocateHeapMemoryIsCalledThenHe
243243
delete dsh;
244244
}
245245

246-
TEST(CommandStreamReceiverSimpleTest, givenCSRWithoutTagAllocationWhenGetTagAllocationIsCalledThenNullptrIsReturned) {
246+
TEST(CommandStreamReceiverSimpleTest, givenCsrWithoutTagAllocationWhenGetTagAllocationIsCalledThenNullptrIsReturned) {
247247
ExecutionEnvironment executionEnvironment;
248248
executionEnvironment.prepareRootDeviceEnvironments(1);
249249
executionEnvironment.initializeMemoryManager();
@@ -307,7 +307,7 @@ HWTEST_F(CommandStreamReceiverTest, givenUltCommandStreamReceiverWhenAddAubComme
307307
EXPECT_TRUE(csr.addAubCommentCalled);
308308
}
309309

310-
TEST(CommandStreamReceiverSimpleTest, givenCSRWhenDownloadAllocationCalledVerifyCallOccurs) {
310+
TEST(CommandStreamReceiverSimpleTest, givenCsrWhenDownloadAllocationCalledVerifyCallOccurs) {
311311
ExecutionEnvironment executionEnvironment;
312312
executionEnvironment.prepareRootDeviceEnvironments(1);
313313
executionEnvironment.initializeMemoryManager();
@@ -672,6 +672,7 @@ struct MockSimulatedCsrHw : public CommandStreamReceiverSimulatedHw<FamilyType>
672672
bool writeMemory(GraphicsAllocation &gfxAllocation) override { return true; }
673673
void writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits) override {}
674674
};
675+
675676
HWTEST_F(SimulatedCommandStreamReceiverTest, givenCsrWithOsContextWhenGetDeviceIndexThenGetHighestEnabledBitInDeviceBitfield) {
676677
ExecutionEnvironment executionEnvironment;
677678
executionEnvironment.prepareRootDeviceEnvironments(1);
@@ -696,7 +697,7 @@ HWTEST_F(SimulatedCommandStreamReceiverTest, givenOsContextWithNoDeviceBitfieldW
696697

697698
using CommandStreamReceiverMultiRootDeviceTest = MultiRootDeviceFixture;
698699

699-
TEST_F(CommandStreamReceiverMultiRootDeviceTest, commandStreamGraphicsAllocationsHaveCorrectRootDeviceIndex) {
700+
TEST_F(CommandStreamReceiverMultiRootDeviceTest, WhenCreatingCommandStreamGraphicsAllocationsThenTheyHaveCorrectRootDeviceIndex) {
700701
auto commandStreamReceiver = &device->getGpgpuCommandStreamReceiver();
701702

702703
ASSERT_NE(nullptr, commandStreamReceiver);
@@ -753,6 +754,7 @@ TEST_F(CommandStreamReceiverMultiRootDeviceTest, commandStreamGraphicsAllocation
753754
}
754755

755756
using CommandStreamReceiverPageTableManagerTest = ::testing::Test;
757+
756758
TEST_F(CommandStreamReceiverPageTableManagerTest, givenNonDefaultEngineTypeWhenNeedsPageTableManagerIsCalledThenFalseIsReturned) {
757759
MockExecutionEnvironment executionEnvironment;
758760
executionEnvironment.initializeMemoryManager();
@@ -764,6 +766,7 @@ TEST_F(CommandStreamReceiverPageTableManagerTest, givenNonDefaultEngineTypeWhenN
764766
EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->pageTableManager.get());
765767
EXPECT_FALSE(commandStreamReceiver.needsPageTableManager(engineType));
766768
}
769+
767770
TEST_F(CommandStreamReceiverPageTableManagerTest, givenDefaultEngineTypeAndExistingPageTableManagerWhenNeedsPageTableManagerIsCalledThenFalseIsReturned) {
768771
MockExecutionEnvironment executionEnvironment;
769772
executionEnvironment.initializeMemoryManager();

0 commit comments

Comments
 (0)