diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2020-10-21 14:46:48 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-21 14:46:48 -0700 |
| commit | 291df751258928bc021a5251585c8733328edf25 (patch) | |
| tree | e6ff3a8819d9d65ba5faa2bfb76108ade17926fb /toolsrc/src/vcpkg-test/util.cpp | |
| parent | 998f86a82946591b1e80ade99a52699967dc66af (diff) | |
| download | vcpkg-291df751258928bc021a5251585c8733328edf25.tar.gz vcpkg-291df751258928bc021a5251585c8733328edf25.zip | |
[vcpkg] Add `versions` feature flag and version field manifest parsing (#14079)
* [vcpkg] Add `versions` feature flag and version field manifest parsing
* Introduce FeatureFlagSettings struct to more easily access feature flags throughout the program
* To avoid users accidentally starting to write "version" instead of "version-string" in their manifests, vcpkg explicitly detects and prevents usage of ports with schemes other than "String"
* Drive-by fix of copiable SourceControlFileLocation and an exposed use-after-move bug
This code is largely extracted from PR #13777
Co-authored-by: Victor Romero <romerosanchezv@gmail.com>
* [vcpkg] Address CR Comments. Fix test crash on Linux.
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Victor Romero <romerosanchezv@gmail.com>
Diffstat (limited to 'toolsrc/src/vcpkg-test/util.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg-test/util.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index 083861bc2..73ff9db5c 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -108,8 +108,10 @@ namespace vcpkg::Test PackageSpec PackageSpecMap::emplace(vcpkg::SourceControlFileLocation&& scfl) { - map.emplace(scfl.source_control_file->core_paragraph->name, std::move(scfl)); - return {scfl.source_control_file->core_paragraph->name, triplet}; + const auto& name = scfl.source_control_file->core_paragraph->name; + REQUIRE(map.find(name) == map.end()); + map.emplace(name, std::move(scfl)); + return {name, triplet}; } static AllowSymlinks internal_can_create_symlinks() noexcept |
