Add finish before command queue is released

Related-To: NEO-5279

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2022-07-19 19:32:15 +00:00
committed by Compute-Runtime-Automation
parent 4d35a76931
commit 50fae92ea2
7 changed files with 32 additions and 2 deletions

View File

@@ -1531,6 +1531,17 @@ TEST(CommandQueueDestructorTest, whenCommandQueueIsDestroyedThenDestroysTimestam
EXPECT_EQ(1, context->getRefInternalCount()); // NOLINT(clang-analyzer-cplusplus.NewDelete)
}
TEST(CommandQueueDestructorTest, GivenCommandQueueWhenDeletedThenFinishIsCalled) {
auto context = std::make_unique<MockContext>();
EXPECT_EQ(1, context->getRefInternalCount());
auto queue = new MockCommandQueue(context.get(), context->getDevice(0), nullptr, false);
cl_int ret = 0;
bool finishCalled = false;
queue->finishCalled = &finishCalled;
releaseQueue(queue, ret);
EXPECT_TRUE(finishCalled); // NOLINT
}
TEST(CommandQueuePropertiesTests, whenGetEngineIsCalledThenQueueEngineIsReturned) {
MockCommandQueue queue;
EngineControl engineControl;