From 7d13495cf90af06bad4351a91a5d7cb868abd2de Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 4 Oct 2016 14:48:39 -0700 Subject: [PATCH] All-CAPS for enum members --- toolsrc/include/package_spec_parse_result.h | 6 +++--- toolsrc/src/package_spec.cpp | 4 ++-- toolsrc/src/package_spec_parse_result.cpp | 6 +++--- toolsrc/src/test.cpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/toolsrc/include/package_spec_parse_result.h b/toolsrc/include/package_spec_parse_result.h index bfb5e82f76..5735c4f4c7 100644 --- a/toolsrc/include/package_spec_parse_result.h +++ b/toolsrc/include/package_spec_parse_result.h @@ -5,9 +5,9 @@ namespace vcpkg { enum class package_spec_parse_result { - success = 0, - too_many_colons, - invalid_characters + SUCCESS = 0, + TOO_MANY_COLONS, + INVALID_CHARACTERS }; struct package_spec_parse_result_category_impl final : std::error_category diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index a578787c93..b9f6f54fef 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -19,7 +19,7 @@ namespace vcpkg auto pos2 = spec_as_string.find(':', pos + 1); if (pos2 != std::string::npos) { - return std::error_code(package_spec_parse_result::too_many_colons); + return std::error_code(package_spec_parse_result::TOO_MANY_COLONS); } const std::string name = spec_as_string.substr(0, pos); @@ -31,7 +31,7 @@ namespace vcpkg { if (std::find_if_not(name.cbegin(), name.cend(), is_valid_package_spec_char) != name.end()) { - return std::error_code(package_spec_parse_result::invalid_characters); + return std::error_code(package_spec_parse_result::INVALID_CHARACTERS); } package_spec p; diff --git a/toolsrc/src/package_spec_parse_result.cpp b/toolsrc/src/package_spec_parse_result.cpp index 6c6c28e21f..d7600ad5b6 100644 --- a/toolsrc/src/package_spec_parse_result.cpp +++ b/toolsrc/src/package_spec_parse_result.cpp @@ -13,11 +13,11 @@ namespace vcpkg { switch (static_cast(ev)) { - case package_spec_parse_result::success: + case package_spec_parse_result::SUCCESS: return "OK"; - case package_spec_parse_result::too_many_colons: + case package_spec_parse_result::TOO_MANY_COLONS: return "Too many colons"; - case package_spec_parse_result::invalid_characters: + case package_spec_parse_result::INVALID_CHARACTERS: return "Contains invalid characters. Only alphanumeric ASCII characters and dashes are allowed"; default: Checks::unreachable(); diff --git a/toolsrc/src/test.cpp b/toolsrc/src/test.cpp index ba35391aa9..476efb2338 100644 --- a/toolsrc/src/test.cpp +++ b/toolsrc/src/test.cpp @@ -309,7 +309,7 @@ namespace UnitTest1 TEST_METHOD(package_spec_parse) { vcpkg::expected spec = vcpkg::package_spec::from_string("zlib", vcpkg::triplet::X86_WINDOWS); - Assert::AreEqual(vcpkg::package_spec_parse_result::success, vcpkg::to_package_spec_parse_result(spec.error_code())); + Assert::AreEqual(vcpkg::package_spec_parse_result::SUCCESS, vcpkg::to_package_spec_parse_result(spec.error_code())); Assert::AreEqual("zlib", spec.get()->name().c_str()); Assert::AreEqual(vcpkg::triplet::X86_WINDOWS.canonical_name(), spec.get()->target_triplet().canonical_name()); } @@ -317,7 +317,7 @@ namespace UnitTest1 TEST_METHOD(package_spec_parse_with_arch) { vcpkg::expected spec = vcpkg::package_spec::from_string("zlib:x64-uwp", vcpkg::triplet::X86_WINDOWS); - Assert::AreEqual(vcpkg::package_spec_parse_result::success, vcpkg::to_package_spec_parse_result(spec.error_code())); + Assert::AreEqual(vcpkg::package_spec_parse_result::SUCCESS, vcpkg::to_package_spec_parse_result(spec.error_code())); Assert::AreEqual("zlib", spec.get()->name().c_str()); Assert::AreEqual(vcpkg::triplet::X64_UWP.canonical_name(), spec.get()->target_triplet().canonical_name()); } @@ -325,7 +325,7 @@ namespace UnitTest1 TEST_METHOD(package_spec_parse_with_multiple_colon) { auto ec = vcpkg::package_spec::from_string("zlib:x86-uwp:", vcpkg::triplet::X86_WINDOWS).error_code(); - Assert::AreEqual(vcpkg::package_spec_parse_result::too_many_colons, vcpkg::to_package_spec_parse_result(ec)); + Assert::AreEqual(vcpkg::package_spec_parse_result::TOO_MANY_COLONS, vcpkg::to_package_spec_parse_result(ec)); } TEST_METHOD(utf8_to_utf16)