@@ -146,6 +146,26 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCall
146146 EXPECT_TRUE (aubCsr->writeMemoryCalled );
147147}
148148
149+ HWTEST_F (AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualIsCalledThenItShouldCallTheExpectedFunctions) {
150+ auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
151+ auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
152+
153+ MockGraphicsAllocation allocation (reinterpret_cast <void *>(0x1000 ), 0x1000 );
154+ aubCsr->expectMemoryEqual (reinterpret_cast <void *>(0x1000 ), reinterpret_cast <void *>(0x1000 ), 0x1000 );
155+
156+ EXPECT_TRUE (aubCsr->expectMemoryEqualCalled );
157+ }
158+
159+ HWTEST_F (AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqualIsCalledThenItShouldCallTheExpectedFunctions) {
160+ auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
161+ auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
162+
163+ MockGraphicsAllocation allocation (reinterpret_cast <void *>(0x1000 ), 0x1000 );
164+ aubCsr->expectMemoryNotEqual (reinterpret_cast <void *>(0x1000 ), reinterpret_cast <void *>(0x1000 ), 0x1000 );
165+
166+ EXPECT_TRUE (aubCsr->expectMemoryNotEqualCalled );
167+ }
168+
149169HWTEST_F (AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
150170 auto mockManager = std::make_unique<MockAubManager>();
151171 auto mockHardwareContext = static_cast <MockHardwareContext *>(mockManager->createHardwareContext (0 , EngineType::ENGINE_RCS));
@@ -181,6 +201,34 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCall
181201 EXPECT_TRUE (mockHardwareContext->writeMemoryCalled );
182202}
183203
204+ HWTEST_F (AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
205+ auto mockManager = std::make_unique<MockAubManager>();
206+ auto mockHardwareContext = static_cast <MockHardwareContext *>(mockManager->createHardwareContext (0 , EngineType::ENGINE_RCS));
207+
208+ auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
209+ auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
210+ aubCsr->hardwareContext = std::unique_ptr<MockHardwareContext>(mockHardwareContext);
211+
212+ MockGraphicsAllocation allocation (reinterpret_cast <void *>(0x1000 ), 0x1000 );
213+ aubCsr->expectMemoryEqual (reinterpret_cast <void *>(0x1000 ), reinterpret_cast <void *>(0x1000 ), 0x1000 );
214+
215+ EXPECT_TRUE (mockHardwareContext->expectMemoryCalled );
216+ }
217+
218+ HWTEST_F (AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqualIsCalledThenItShouldCallTheExpectedHwContextFunctions) {
219+ auto mockManager = std::make_unique<MockAubManager>();
220+ auto mockHardwareContext = static_cast <MockHardwareContext *>(mockManager->createHardwareContext (0 , EngineType::ENGINE_RCS));
221+
222+ auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
223+ auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
224+ aubCsr->hardwareContext = std::unique_ptr<MockHardwareContext>(mockHardwareContext);
225+
226+ MockGraphicsAllocation allocation (reinterpret_cast <void *>(0x1000 ), 0x1000 );
227+ aubCsr->expectMemoryNotEqual (reinterpret_cast <void *>(0x1000 ), reinterpret_cast <void *>(0x1000 ), 0x1000 );
228+
229+ EXPECT_TRUE (mockHardwareContext->expectMemoryCalled );
230+ }
231+
184232HWTEST_F (AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenFileStreamShouldBeFlushed) {
185233 auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(true , true , true );
186234 auto aubCsr = aubExecutionEnvironment->template getCsr <AUBCommandStreamReceiverHw<FamilyType>>();
0 commit comments