mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Refactoring HwDeviceId
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
b2fae343ec
commit
67aa1ad7ec
@ -122,16 +122,16 @@ TEST(DrmTest, GivenSelectedExistingDeviceWhenOpenDirSuccedsThenHwDeviceIdsHavePr
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_EQ(1u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
|
||||
entryIndex = 0;
|
||||
openCounter = 2;
|
||||
hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_EQ(2u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, GivenSelectedExistingDeviceWhenOpenDirFailsThenRetryOpeningRenderDevices) {
|
||||
@ -146,16 +146,16 @@ TEST(DrmTest, GivenSelectedExistingDeviceWhenOpenDirFailsThenRetryOpeningRenderD
|
||||
EXPECT_STREQ("/dev/dri/renderD128", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(1u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
|
||||
openCounter = 2;
|
||||
hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_STREQ("/dev/dri/renderD129", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(2u, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, givenPrintIoctlEntriesWhenCallIoctlThenIoctlIsPrinted) {
|
||||
@ -286,9 +286,9 @@ TEST(DrmTest, GivenFailingOpenDirAndMultipleAvailableDevicesWhenCreateMultipleRo
|
||||
EXPECT_STREQ("/dev/dri/renderD129", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(requestedNumRootDevices, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("00:02.0", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("00:03.0", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, GivenMultipleAvailableDevicesWhenCreateMultipleRootDevicesFlagIsSetThenTheFlagIsRespected) {
|
||||
@ -304,9 +304,9 @@ TEST(DrmTest, GivenMultipleAvailableDevicesWhenCreateMultipleRootDevicesFlagIsSe
|
||||
EXPECT_STREQ("/dev/dri/by-path/pci-0000:test2-render", lastOpenedPath.c_str());
|
||||
EXPECT_EQ(requestedNumRootDevices, hwDeviceIds.size());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[0].get());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->getPciPath());
|
||||
EXPECT_STREQ("test1", hwDeviceIds[0]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
EXPECT_NE(nullptr, hwDeviceIds[1].get());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->getPciPath());
|
||||
EXPECT_STREQ("test2", hwDeviceIds[1]->as<HwDeviceIdDrm>()->getPciPath());
|
||||
}
|
||||
|
||||
TEST(DrmTest, GivenSelectedIncorectDeviceWhenGetDeviceFdThenFail) {
|
||||
|
Reference in New Issue
Block a user