Fix issue with /permissive-
MODIFY
include/tests.utils.h
include/tests.utils.h
namespace Microsoft::VisualStudio::CppUnitTestFramework
{
- std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t);
- std::wstring ToString(const vcpkg::Dependencies::RequestType& t);
- std::wstring ToString(const vcpkg::PackageSpecParseResult& t);
- std::wstring ToString(const vcpkg::PackageSpec& t);
+ template<>
+ std::wstring ToString<vcpkg::Dependencies::InstallPlanType>(const vcpkg::Dependencies::InstallPlanType& t)
+ {
+ switch (t)
+ {
+ case vcpkg::Dependencies::InstallPlanType::ALREADY_INSTALLED: return L"ALREADY_INSTALLED";
+ case vcpkg::Dependencies::InstallPlanType::BUILD_AND_INSTALL: return L"BUILD_AND_INSTALL";
+ case vcpkg::Dependencies::InstallPlanType::EXCLUDED: return L"EXCLUDED";
+ case vcpkg::Dependencies::InstallPlanType::UNKNOWN: return L"UNKNOWN";
+ default: return ToString(static_cast<int>(t));
+ }
+ }
+
+ template<>
+ std::wstring ToString<vcpkg::Dependencies::RequestType>(const vcpkg::Dependencies::RequestType& t)
+ {
+ switch (t)
+ {
+ case vcpkg::Dependencies::RequestType::AUTO_SELECTED: return L"AUTO_SELECTED";
+ case vcpkg::Dependencies::RequestType::USER_REQUESTED: return L"USER_REQUESTED";
+ case vcpkg::Dependencies::RequestType::UNKNOWN: return L"UNKNOWN";
+ default: return ToString(static_cast<int>(t));
+ }
+ }
+
+ template<>
+ std::wstring ToString<vcpkg::PackageSpecParseResult>(const vcpkg::PackageSpecParseResult& t)
+ {
+ return ToString(static_cast<uint32_t>(t));
+ }
+
+ template<>
+ std::wstring ToString<vcpkg::PackageSpec>(const vcpkg::PackageSpec& t)
+ {
+ return ToString(t.to_string());
+ }
}
std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name,

MODIFY
src/tests.paragraph.cpp
src/tests.paragraph.cpp
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
-namespace Microsoft::VisualStudio::CppUnitTestFramework
-{
- template<>
- inline std::wstring ToString<vcpkg::PackageSpecParseResult>(const vcpkg::PackageSpecParseResult& t)
- {
- return ToString(static_cast<uint32_t>(t));
- }
-}
-
namespace Strings = vcpkg::Strings;
namespace UnitTest1

MODIFY
src/tests.utils.cpp
src/tests.utils.cpp
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace vcpkg;
-namespace Microsoft::VisualStudio::CppUnitTestFramework
-{
- std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t)
- {
- switch (t)
- {
- case Dependencies::InstallPlanType::ALREADY_INSTALLED: return L"ALREADY_INSTALLED";
- case Dependencies::InstallPlanType::BUILD_AND_INSTALL: return L"BUILD_AND_INSTALL";
- case Dependencies::InstallPlanType::EXCLUDED: return L"EXCLUDED";
- case Dependencies::InstallPlanType::UNKNOWN: return L"UNKNOWN";
- default: return ToString(static_cast<int>(t));
- }
- }
-
- std::wstring ToString(const vcpkg::Dependencies::RequestType& t)
- {
- switch (t)
- {
- case Dependencies::RequestType::AUTO_SELECTED: return L"AUTO_SELECTED";
- case Dependencies::RequestType::USER_REQUESTED: return L"USER_REQUESTED";
- case Dependencies::RequestType::UNKNOWN: return L"UNKNOWN";
- default: return ToString(static_cast<int>(t));
- }
- }
-
- std::wstring ToString(const vcpkg::PackageSpecParseResult& t) { return ToString(static_cast<uint32_t>(t)); }
-
- std::wstring ToString(const vcpkg::PackageSpec& t) { return ToString(t.to_string()); }
-}
-
std::unique_ptr<StatusParagraph> make_status_pgh(const char* name,
const char* depends,
const char* default_features,

Fix #3170 issue with /permissive-