Skip to content

Commit

Permalink
fix(unit-tests): match warning messages on unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Ezequiel Moltrasio <[email protected]>
  • Loading branch information
Molter73 committed Aug 7, 2024
1 parent 3c70d7e commit c054cea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions unit_tests/engine/test_rule_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ TEST_F(test_falco_engine, exceptions_values_rhs_field_ambiguous)

ASSERT_TRUE(load_rules(rules_content, "rules.yaml"));
EXPECT_EQ(get_compiled_rule_condition("test_rule"), "(evt.type = open and not proc.name = proc.pname)");
EXPECT_TRUE(check_warning_message("string 'proc.pname' may be a valid field wrongly interpreted as a string value"));
EXPECT_TRUE(check_warning_message("'proc.pname' may be a valid field misused as a const string value"));
}

TEST_F(test_falco_engine, exceptions_values_rhs_field_ambiguous_quoted)
Expand All @@ -1050,7 +1050,7 @@ TEST_F(test_falco_engine, exceptions_values_rhs_field_ambiguous_quoted)

ASSERT_TRUE(load_rules(rules_content, "rules.yaml"));
EXPECT_EQ(get_compiled_rule_condition("test_rule"), "(evt.type = open and not proc.name = proc.pname)");
EXPECT_TRUE(check_warning_message("string 'proc.pname' may be a valid field wrongly interpreted as a string value"));
EXPECT_TRUE(check_warning_message("'proc.pname' may be a valid field misused as a const string value"));
}

TEST_F(test_falco_engine, exceptions_values_rhs_field_ambiguous_space_quoted)
Expand All @@ -1066,7 +1066,7 @@ TEST_F(test_falco_engine, exceptions_values_rhs_field_ambiguous_space_quoted)

ASSERT_TRUE(load_rules(rules_content, "rules.yaml"));
EXPECT_EQ(get_compiled_rule_condition("test_rule"), "(evt.type = open and not proc.name = \"proc.pname \")");
EXPECT_TRUE(check_warning_message("string 'proc.pname ' may be a valid field wrongly interpreted as a string value"));
EXPECT_TRUE(check_warning_message("'proc.pname ' may be a valid field misused as a const string value"));
}

TEST_F(test_falco_engine, exceptions_values_rhs_transformer)
Expand Down Expand Up @@ -1112,7 +1112,7 @@ TEST_F(test_falco_engine, exceptions_values_transformer_space)

ASSERT_TRUE(load_rules(rules_content, "rules.yaml"));
EXPECT_EQ(get_compiled_rule_condition("test_rule"), "(evt.type = open and not proc.name = \"toupper( proc.pname)\")");
EXPECT_TRUE(check_warning_message("string 'toupper( proc.pname)' may be a valid field transformer wrongly interpreted as a string value"));
EXPECT_TRUE(check_warning_message("'toupper( proc.pname)' may be a valid field transformer misused as a const string value"));
}

TEST_F(test_falco_engine, exceptions_values_transformer_space_quoted)
Expand All @@ -1128,7 +1128,7 @@ TEST_F(test_falco_engine, exceptions_values_transformer_space_quoted)

ASSERT_TRUE(load_rules(rules_content, "rules.yaml"));
EXPECT_EQ(get_compiled_rule_condition("test_rule"), "(evt.type = open and not proc.name = \"toupper( proc.pname)\")");
EXPECT_TRUE(check_warning_message("string 'toupper( proc.pname)' may be a valid field transformer wrongly interpreted as a string value"));
EXPECT_TRUE(check_warning_message("'toupper( proc.pname)' may be a valid field transformer misused as a const string value"));
}

TEST_F(test_falco_engine, exceptions_fields_transformer)
Expand Down

0 comments on commit c054cea

Please sign in to comment.