mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Add control on platform life cycle.
Change-Id: I5c24b41747d822b71dd57e9a949cf25fcc78a453
This commit is contained in:
committed by
sys_ocldev
parent
0f91c3bc47
commit
a21c0a0074
@@ -195,3 +195,24 @@ TEST_F(PlatformTest, testRemoveLastSpace) {
|
||||
removeLastSpace(xSpaceString);
|
||||
EXPECT_EQ(std::string("x"), xSpaceString);
|
||||
}
|
||||
TEST(PlatformConstructionTest, givenPlatformConstructorWhenItIsCalledTwiceThenTheSamePlatformIsReturned) {
|
||||
ASSERT_EQ(nullptr, platformImpl);
|
||||
auto platform = constructPlatform();
|
||||
EXPECT_EQ(platform, platformImpl.get());
|
||||
auto platform2 = constructPlatform();
|
||||
EXPECT_EQ(platform2, platform);
|
||||
EXPECT_NE(platform, nullptr);
|
||||
platformImpl.reset(nullptr);
|
||||
}
|
||||
|
||||
TEST(PlatformConstructionTest, givenPlatformConstructorWhenItIsCalledAfterResetThenNewPlatformIsConstructed) {
|
||||
ASSERT_EQ(nullptr, platformImpl);
|
||||
auto platform = constructPlatform();
|
||||
std::unique_ptr<Platform> temporaryOwnership(std::move(platformImpl));
|
||||
EXPECT_EQ(nullptr, platformImpl.get());
|
||||
auto platform2 = constructPlatform();
|
||||
EXPECT_NE(platform2, platform);
|
||||
EXPECT_NE(platform, nullptr);
|
||||
EXPECT_NE(platform2, nullptr);
|
||||
platformImpl.reset(nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user