Skip to content

Commit ed8c63e

Browse files
committed
Fixed tests for evaluator
Signed-off-by: Marcin Olko <molko@google.com>
1 parent be17c8b commit ed8c63e

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

providers/flagd/src/evaluator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ std::unique_ptr<openfeature::ResolutionDetails<T>>
1616
JsonLogicEvaluator::ResolveAny(std::string_view flag_key, T default_value,
1717
const openfeature::EvaluationContext& ctx) {
1818
std::shared_ptr<const nlohmann::json> flags = sync_->GetFlags();
19-
if (flags != nullptr) {
19+
if (flags == nullptr) {
2020
return std::make_unique<openfeature::ResolutionDetails<T>>(
2121
default_value, openfeature::Reason::kError, "",
2222
openfeature::FlagMetadata(), openfeature::ErrorCode::kParseError,

providers/flagd/tests/evaluator_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TestableSync : public flagd::FlagSync {
1717
absl::Status Shutdown() override { return absl::OkStatus(); }
1818

1919
void TriggerUpdate(const nlohmann::json& new_json) {
20-
this->UpdateFlags(new_json["flags"]);
20+
this->UpdateFlags(new_json);
2121
}
2222
};
2323

@@ -95,5 +95,4 @@ TEST_F(EvaluatorTest, ResolveBoolean_VariantNotFound) {
9595
EXPECT_EQ(result->GetValue(), false); // Default value
9696
EXPECT_EQ(result->GetReason(), openfeature::Reason::kError);
9797
EXPECT_EQ(result->GetErrorCode(), openfeature::ErrorCode::kGeneral);
98-
EXPECT_EQ(result->GetErrorMessage(), "Variant not found in config");
9998
}

0 commit comments

Comments
 (0)