| 77 | } |
| 78 | |
| 79 | static std::filesystem::path ExpandPath(const std::filesystem::path &path) { |
| 80 | std::string str = path.string(); |
| 81 | |
| 82 | #if _WIN32 |
| 83 | // Determine the expected size |
| 84 | DWORD size = ExpandEnvironmentStringsA(str.c_str(), nullptr, 0); |
| 85 | if (size == 0) { |
| 86 | return path; |
| 87 | } |
| 88 | |
| 89 | // Preallocate exapnded |
| 90 | std::string expanded; |
| 91 | expanded.resize(size - 1u); |
| 92 | |
| 93 | // For +1u, see https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsa |
| 94 | ExpandEnvironmentStringsA(str.c_str(), expanded.data(), size + 1u); |
| 95 | expanded.pop_back(); |
| 96 | |
| 97 | // OK |
| 98 | return expanded; |
| 99 | #else // _WIN32 |
| 100 | #error Not implemented |
| 101 | #endif // _WIN32 |
| 102 | } |
| 103 | |
| 104 | bool Parser::ParseApplication(const nlohmann::json &json, ComRef<ITestPass>& out) { |
| 105 | ApplicationInfo info; |
no test coverage detected