From a400efc3edecbb8286cee81d07e3e654a2dbfd4a Mon Sep 17 00:00:00 2001 From: Antonio Ruiz Date: Mon, 1 Jan 2024 22:24:40 +0100 Subject: [PATCH] Change feature_enabled to camelCase format --- README.md | 2 +- include/unleash/variants/variant.h | 2 +- src/feature.cpp | 2 +- src/unleashclient.cpp | 2 +- test/tests.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e0d734b..0cf664b 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ unleashClient.isEnabled("feature.toogle"); std::string name; unsigned int weight; bool enabled; - bool feature_enabled; + bool featureEnabled; std::string payload; } */ diff --git a/include/unleash/variants/variant.h b/include/unleash/variants/variant.h index 3fa9ca4..4a52bfd 100644 --- a/include/unleash/variants/variant.h +++ b/include/unleash/variants/variant.h @@ -16,7 +16,7 @@ struct variant_t { std::string name; unsigned int weight; bool enabled; - bool feature_enabled; + bool featureEnabled; std::string payload; }; diff --git a/src/feature.cpp b/src/feature.cpp index 40029b2..4919e30 100644 --- a/src/feature.cpp +++ b/src/feature.cpp @@ -25,7 +25,7 @@ variant_t Feature::getVariant(const unleash::Context &context) const { variant_t variant{"disabled", 0, false, false}; if (!isEnabled(context)) { return variant; } - variant.feature_enabled = true; + variant.featureEnabled = true; if (m_variants.first.empty()) { return variant; } variant.enabled = true; diff --git a/src/unleashclient.cpp b/src/unleashclient.cpp index d334d48..e62034a 100644 --- a/src/unleashclient.cpp +++ b/src/unleashclient.cpp @@ -113,7 +113,7 @@ bool UnleashClient::isEnabled(const std::string &flag, const Context &context) { variant_t UnleashClient::variant(const std::string &flag, const unleash::Context &context) { variant_t variant{"disabled", 0, false, false}; if (m_isInitialized) { - variant.feature_enabled = isEnabled(flag, context); + variant.featureEnabled = isEnabled(flag, context); if (auto search = m_features.find(flag); search != m_features.end()) { return m_features.at(flag).getVariant(context); } diff --git a/test/tests.cpp b/test/tests.cpp index 06f0b07..6a6e1f1 100644 --- a/test/tests.cpp +++ b/test/tests.cpp @@ -125,7 +125,7 @@ TEST_P(UnleashSpecificationTest, TestSet) { std::cout << value["toggleName"] << std::endl; nlohmann::json expectedResult = value["expectedResult"]; auto variant = unleashClient.variant(value["toggleName"], testContext); - EXPECT_EQ(expectedResult["feature_enabled"], variant.feature_enabled); + EXPECT_EQ(expectedResult["feature_enabled"], variant.featureEnabled); EXPECT_EQ(expectedResult["enabled"], variant.enabled); EXPECT_EQ(expectedResult["name"], variant.name); if (expectedResult.contains("payload")) EXPECT_EQ(expectedResult["payload"].dump(), variant.payload);