Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/framework/icd/test_icd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ bool should_check(std::vector<const char*>* exts, VkDevice device, const char* e
}

PFN_vkVoidFunction get_device_func(VkDevice device, const char* pName) {
std::vector<const char*>* enabled_extensions;
std::vector<const char*>* enabled_extensions = nullptr;
FindDevice found_device{};
if (device != nullptr) {
found_device = lookup_device(device);
Expand Down
16 changes: 7 additions & 9 deletions tests/framework/util/folder_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,18 @@ FileSystemManager::FileSystemManager()
fs::Folder& FileSystemManager::get_folder(ManifestLocation location) noexcept { return folders.at(location); }
fs::Folder const& FileSystemManager::get_folder(ManifestLocation location) const noexcept { return folders.at(location); }

Folder* FileSystemManager::get_folder_for_given_path(std::filesystem::path const& given_path) noexcept {
auto normalized_path = given_path.lexically_normal();
Folder* FileSystemManager::get_folder_for_given_path(std::string_view given_path) noexcept {
for (auto const& [manifest_location, folder] : folders) {
if (folder.location() == normalized_path) {
if (folder.location() == given_path) {
return &folders.at(manifest_location);
}
}
if (redirected_paths.count(given_path.string()) > 0) {
return &folders.at(redirected_paths.at(normalized_path.string()));
}
for (auto const& [redirected_path_str, redirected_location] : redirected_paths) {
std::filesystem::path redirected_path = redirected_path_str;
for (auto const& [redirected_path, redirected_location] : redirected_paths) {
if (redirected_path == given_path) {
return &folders.at(redirected_location);
}
const auto mismatch_pair =
std::mismatch(normalized_path.begin(), normalized_path.end(), redirected_path.begin(), redirected_path.end());
std::mismatch(given_path.begin(), given_path.end(), redirected_path.begin(), redirected_path.end());
if (mismatch_pair.second == redirected_path.end()) return &folders.at(redirected_location);
}
return nullptr;
Expand Down
3 changes: 2 additions & 1 deletion tests/framework/util/folder_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <filesystem>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>

Expand Down Expand Up @@ -87,7 +88,7 @@ class FileSystemManager {
Folder const& get_folder(ManifestLocation location) const noexcept;

// Gets a pointer to the folder that given_path points to. This includes redirected paths as well as the exact path of folders
Folder* get_folder_for_given_path(std::filesystem::path const& given_path) noexcept;
Folder* get_folder_for_given_path(std::string_view given_path) noexcept;

bool is_folder_path(std::filesystem::path const& path) const noexcept;

Expand Down
Loading