fix(tests): remove unused variables in rule loader tests

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
Samuel Gaist 2024-02-18 10:41:10 +01:00 committed by poiana
parent 1178a0505c
commit e07f056fc5

View File

@ -195,8 +195,6 @@ TEST_F(test_falco_engine, rule_incorrect_override_type)
priority: append
)END";
std::string rule_name = "failing_rule";
ASSERT_FALSE(load_rules(rules_content, "rules.yaml"));
ASSERT_TRUE(check_error_message("Key 'priority' cannot be appended to, use 'replace' instead"));
ASSERT_TRUE(std::string(m_load_result_json["errors"][0]["context"]["snippet"]).find("priority: append") != std::string::npos);
@ -220,8 +218,6 @@ TEST_F(test_falco_engine, rule_incorrect_append_override)
condition: append
)END";
std::string rule_name = "failing_rule";
ASSERT_FALSE(load_rules(rules_content, "rules.yaml"));
// We should have at least one warning because the 'append' flag is deprecated.
@ -608,8 +604,6 @@ TEST_F(test_falco_engine, rule_override_without_field)
condition: append
)END";
std::string rule_name = "failing_rule";
ASSERT_FALSE(load_rules(rules_content, "rules.yaml"));
ASSERT_TRUE(check_error_message("An append override for 'condition' was specified but 'condition' is not defined"));
}
@ -632,8 +626,6 @@ TEST_F(test_falco_engine, rule_override_extra_field)
condition: append
)END";
std::string rule_name = "failing_rule";
ASSERT_FALSE(load_rules(rules_content, "rules.yaml"));
ASSERT_TRUE(check_error_message("Unexpected key 'priority'"));
}