@@ -24,44 +24,44 @@ struct IndirectHeapTest : public ::testing::Test {
2424 IndirectHeap indirectHeap = {&gfxAllocation};
2525};
2626
27- TEST_F (IndirectHeapTest, getSpaceTestSizeZero ) {
27+ TEST_F (IndirectHeapTest, GivenSizeZeroWhenGettingSpaceThenNonNullPtrIsReturned ) {
2828 EXPECT_NE (nullptr , indirectHeap.getSpace (0 ));
2929}
3030
31- TEST_F (IndirectHeapTest, getSpaceTestSizeNonZero ) {
31+ TEST_F (IndirectHeapTest, GivenNonZeroSizeWhenGettingSpaceThenNonNullPtrIsReturned ) {
3232 EXPECT_NE (nullptr , indirectHeap.getSpace (sizeof (uint32_t )));
3333}
3434
35- TEST_F (IndirectHeapTest, getSpaceTestReturnsWritablePointer ) {
35+ TEST_F (IndirectHeapTest, WhenGettingSpaceThenReturnedPointerIsWriteable ) {
3636 uint32_t cmd = 0xbaddf00d ;
3737 auto pCmd = indirectHeap.getSpace (sizeof (cmd));
3838 ASSERT_NE (nullptr , pCmd);
3939 *(uint32_t *)pCmd = cmd;
4040}
4141
42- TEST_F (IndirectHeapTest, getSpaceReturnsDifferentPointersForEachRequest ) {
42+ TEST_F (IndirectHeapTest, WhenGettingThenEachCallReturnsDifferentPointers ) {
4343 auto pCmd = indirectHeap.getSpace (sizeof (uint32_t ));
4444 ASSERT_NE (nullptr , pCmd);
4545 auto pCmd2 = indirectHeap.getSpace (sizeof (uint32_t ));
4646 ASSERT_NE (pCmd2, pCmd);
4747}
4848
49- TEST_F (IndirectHeapTest, getMaxAvailableSpace ) {
49+ TEST_F (IndirectHeapTest, GivenNoAllocationWhenGettingAvailableSpaceThenEqualsMaxAvailableSpace ) {
5050 ASSERT_EQ (indirectHeap.getMaxAvailableSpace (), indirectHeap.getAvailableSpace ());
5151}
5252
53- TEST_F (IndirectHeapTest, getAvailableSpaceShouldBeNonZeroAfterInit ) {
53+ TEST_F (IndirectHeapTest, GivenNoAllocationWhenGettingAvailableSpaceThenSizeIsGreaterThenZero ) {
5454 EXPECT_NE (0u , indirectHeap.getAvailableSpace ());
5555}
5656
57- TEST_F (IndirectHeapTest, getSpaceReducesAvailableSpace ) {
57+ TEST_F (IndirectHeapTest, GivenNonZeroSpaceWhenGettingSpaceThenAvailableSpaceIsReduced ) {
5858 auto originalAvailable = indirectHeap.getAvailableSpace ();
5959 indirectHeap.getSpace (sizeof (uint32_t ));
6060
6161 EXPECT_LT (indirectHeap.getAvailableSpace (), originalAvailable);
6262}
6363
64- TEST_F (IndirectHeapTest, align ) {
64+ TEST_F (IndirectHeapTest, GivenAlignmentWhenGettingSpaceThenPointerIsAligned ) {
6565 size_t alignment = 64 * sizeof (uint8_t );
6666 indirectHeap.align (alignment);
6767
@@ -73,7 +73,7 @@ TEST_F(IndirectHeapTest, align) {
7373 EXPECT_EQ (0u , address % alignment);
7474}
7575
76- TEST_F (IndirectHeapTest, alignShouldAlignUpward ) {
76+ TEST_F (IndirectHeapTest, GivenAlignmentWhenGettingSpaceThenPointerIsAlignedUpward ) {
7777 size_t size = 1 ;
7878 auto ptr1 = indirectHeap.getSpace (size);
7979 ASSERT_NE (nullptr , ptr1);
0 commit comments