mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
refactor regex when scanning pci paths
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
ba767dfbaf
commit
6769df2f5d
@ -853,3 +853,25 @@ TEST_F(DrmTests, givenValidPciPathThenPciBusInfoIsAvailable) {
|
||||
EXPECT_EQ(drm->getPciBusInfo().pciFunction, referenceData[idx - 7][3]);
|
||||
}
|
||||
}
|
||||
TEST_F(DrmTests, givenInValidPciPathThenNothingIsReturned) {
|
||||
VariableBackup<decltype(openFull)> backupOpenFull(&openFull);
|
||||
VariableBackup<decltype(failOnOpenDir)> backupOpenDir(&failOnOpenDir, false);
|
||||
VariableBackup<decltype(entryIndex)> backupEntryIndex(&entryIndex, 0u);
|
||||
|
||||
openFull = openWithCounter;
|
||||
|
||||
entryIndex = 11;
|
||||
openCounter = 1;
|
||||
auto hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_TRUE(hwDeviceIds.empty());
|
||||
|
||||
entryIndex = 12;
|
||||
openCounter = 1;
|
||||
hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_TRUE(hwDeviceIds.empty());
|
||||
|
||||
entryIndex = 13;
|
||||
openCounter = 1;
|
||||
hwDeviceIds = OSInterface::discoverDevices(executionEnvironment);
|
||||
EXPECT_TRUE(hwDeviceIds.empty());
|
||||
}
|
||||
|
@ -115,6 +115,9 @@ struct dirent entries[] = {
|
||||
{0, 0, 0, 0, "pci-0000:b3:03.1-render"},
|
||||
{0, 0, 0, 0, "pci-0000:00:b3.1-render"},
|
||||
{0, 0, 0, 0, "pci-0000:00:03.a-render"},
|
||||
{0, 0, 0, 0, "pci-0000:00:03.a-render-12"},
|
||||
{0, 0, 0, 0, "pcii0000:00:03.a-render"},
|
||||
{0, 0, 0, 0, "pcii-render"},
|
||||
};
|
||||
|
||||
uint32_t entryIndex = 0u;
|
||||
|
Reference in New Issue
Block a user