Skip to content

Commit a3d9775

Browse files
Revert "Fix backward loop condition in tests"
This reverts commit f0ecb5a.
1 parent 770660a commit a3d9775

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

tests/loader_version_tests.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -994,24 +994,20 @@ void CheckDirectDriverLoading(FrameworkEnvironment& env, std::vector<DriverInfo>
994994
// We have to iterate through the driver lists backwards because the loader *prepends* icd's, so the last found ICD is found
995995
// first in the driver list
996996
uint32_t driver_index = 0;
997-
if (!normal_drivers.empty()) {
998-
for (int i = normal_drivers.size() - 1; i >= 0; i--) {
999-
if (!exclusive && normal_drivers.at(i).expect_to_find) {
1000-
VkPhysicalDeviceProperties props{};
1001-
inst.functions->vkGetPhysicalDeviceProperties(phys_devs.at(driver_index), &props);
1002-
ASSERT_EQ(props.driverVersion, normal_drivers.at(i).driver_version);
1003-
driver_index++;
1004-
}
997+
for (size_t i = normal_drivers.size() - 1; i == 0; i--) {
998+
if (normal_drivers.at(i).expect_to_find) {
999+
VkPhysicalDeviceProperties props{};
1000+
inst.functions->vkGetPhysicalDeviceProperties(phys_devs.at(driver_index), &props);
1001+
ASSERT_EQ(props.driverVersion, normal_drivers.at(i).driver_version);
1002+
driver_index++;
10051003
}
10061004
}
1007-
if (!direct_drivers.empty()) {
1008-
for (int i = direct_drivers.size() - 1; i >= 0; i--) {
1009-
if (direct_drivers.at(i).expect_to_find) {
1010-
VkPhysicalDeviceProperties props{};
1011-
inst.functions->vkGetPhysicalDeviceProperties(phys_devs.at(driver_index), &props);
1012-
ASSERT_EQ(props.driverVersion, direct_drivers.at(i).driver_version);
1013-
driver_index++;
1014-
}
1005+
for (size_t i = direct_drivers.size() - 1; i == 0; i--) {
1006+
if (direct_drivers.at(i).expect_to_find) {
1007+
VkPhysicalDeviceProperties props{};
1008+
inst.functions->vkGetPhysicalDeviceProperties(phys_devs.at(driver_index), &props);
1009+
ASSERT_EQ(props.driverVersion, direct_drivers.at(i).driver_version);
1010+
driver_index++;
10151011
}
10161012
}
10171013
}

0 commit comments

Comments
 (0)