Add control on platform life cycle.

Change-Id: I5c24b41747d822b71dd57e9a949cf25fcc78a453
This commit is contained in:
Mrozek, Michal
2018-06-26 16:15:48 +02:00
committed by sys_ocldev
parent 0f91c3bc47
commit a21c0a0074
27 changed files with 90 additions and 31 deletions

View File

@@ -55,6 +55,7 @@ class AsyncEventsHandlerTests : public ::testing::Test {
}
void SetUp() override {
constructPlatform();
dbgRestore.reset(new DebugManagerStateRestore());
DebugManager.flags.EnableAsyncEventsHandler.set(false);
handler.reset(new MockHandler());
@@ -68,6 +69,7 @@ class AsyncEventsHandlerTests : public ::testing::Test {
event1->release();
event2->release();
event3->release();
platformImpl.reset(nullptr);
}
std::unique_ptr<DebugManagerStateRestore> dbgRestore;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -56,6 +56,7 @@ TEST(EventCallbackTest, NestedCallbacksAreCalledForUserEvent) {
}
TEST(EventCallbackTest, NestedCallbacksAreCalledForEvent) {
constructPlatform();
std::unique_ptr<Device> device(DeviceHelper<>::create());
MockContext context;
MockCommandQueue queue(&context, device.get(), nullptr);
@@ -68,4 +69,5 @@ TEST(EventCallbackTest, NestedCallbacksAreCalledForEvent) {
platform()->getAsyncEventsHandler()->closeThread();
EXPECT_EQ(4u, nestLevel);
platformImpl.reset(nullptr);
}