mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-22 03:12:02 +08:00
fix: ensure system info is queried only once
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0cdfa882eb
commit
7f6c6c6bb9
@@ -130,6 +130,21 @@ TEST(DrmSystemInfoTest, whenSetupHardwareInfoThenReleaseHelperContainsCorrectIpV
|
||||
EXPECT_EQ(55u, exposedReleaseHelper->hardwareIpVersion.release);
|
||||
}
|
||||
|
||||
TEST(DrmSystemInfoTest, whenQueryingSystemInfoTwiceThenSystemInfoIsCreatedOnlyOnce) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMockEngine drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
EXPECT_TRUE(drm.querySystemInfo());
|
||||
|
||||
auto systemInfo = drm.getSystemInfo();
|
||||
EXPECT_NE(nullptr, systemInfo);
|
||||
EXPECT_EQ(2u + drm.getBaseIoctlCalls(), drm.ioctlCallsCount);
|
||||
|
||||
EXPECT_TRUE(drm.querySystemInfo());
|
||||
EXPECT_EQ(systemInfo, drm.getSystemInfo());
|
||||
EXPECT_EQ(2u + drm.getBaseIoctlCalls(), drm.ioctlCallsCount);
|
||||
}
|
||||
|
||||
TEST(DrmSystemInfoTest, whenQueryingSystemInfoThenSystemInfoIsCreatedAndReturnsNonZeros) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMockEngine drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
Reference in New Issue
Block a user