Rename free procedures

This commit is contained in:
2024-10-26 19:36:42 +01:00
parent e508cc62f5
commit 0ecab6c142
5 changed files with 40 additions and 41 deletions

View File

@@ -14,7 +14,7 @@ static void a_has_1_alternative(void)
const int result = PARSE_EXPR_STRING("a", &t);
ASSERT_NE(-1, result);
ASSERT_EQ(1, t.count);
regex_free_children(&t);
regex_free(&t);
}
static void a_pipe_b_has_2_alternatives(void)
@@ -23,7 +23,7 @@ static void a_pipe_b_has_2_alternatives(void)
const int result = PARSE_EXPR_STRING("a|b", &t);
ASSERT_NE(-1, result);
ASSERT_EQ(2, t.count);
regex_free_children(&t);
regex_free(&t);
}
static void a_pipe_b_pipe_c_has_3_alternatives(void)
@@ -32,7 +32,7 @@ static void a_pipe_b_pipe_c_has_3_alternatives(void)
const int result = PARSE_EXPR_STRING("a|b|c", &t);
ASSERT_NE(-1, result);
ASSERT_EQ(3, t.count);
regex_free_children(&t);
regex_free(&t);
}
static void a_is_parsed_as_unquantified_literal(void)
@@ -48,7 +48,7 @@ static void a_is_parsed_as_unquantified_literal(void)
ASSERT_EQ(REGEX_TERM_LITERAL, t.contents[0].contents[0].type);
ASSERT_EQ('a', t.contents[0].contents[0].literal);
regex_free_children(&t);
regex_free(&t);
}
static void b_is_parsed_as_unquantified_literal(void)
@@ -64,7 +64,7 @@ static void b_is_parsed_as_unquantified_literal(void)
ASSERT_EQ(REGEX_TERM_LITERAL, t.contents[0].contents[0].type);
ASSERT_EQ('b', t.contents[0].contents[0].literal);
regex_free_children(&t);
regex_free(&t);
}
static void abc_is_parsed_as_sequence_of_unquantified_literals(void)
@@ -86,7 +86,7 @@ static void abc_is_parsed_as_sequence_of_unquantified_literals(void)
ASSERT_EQ(REGEX_TERM_LITERAL, t.contents[0].contents[2].type);
ASSERT_EQ('c', t.contents[0].contents[2].literal);
regex_free_children(&t);
regex_free(&t);
}
static void dot_is_parsed_as_unquantified_wildcard_term(void)
@@ -101,7 +101,7 @@ static void dot_is_parsed_as_unquantified_wildcard_term(void)
ASSERT_EQ(REGEX_QUANTIFIER_NONE, t.contents[0].contents[0].quantifier);
ASSERT_EQ(REGEX_TERM_WILDCARD, t.contents[0].contents[0].type);
regex_free_children(&t);
regex_free(&t);
}
static void backslash_dot_is_parsed_as_unquantified_literal(void)
@@ -117,7 +117,7 @@ static void backslash_dot_is_parsed_as_unquantified_literal(void)
ASSERT_EQ(REGEX_TERM_LITERAL, t.contents[0].contents[0].type);
ASSERT_EQ('.', t.contents[0].contents[0].literal);
regex_free_children(&t);
regex_free(&t);
}
static void backslash_backslash_is_parsed_as_unquantified_literal(void)
@@ -133,7 +133,7 @@ static void backslash_backslash_is_parsed_as_unquantified_literal(void)
ASSERT_EQ(REGEX_TERM_LITERAL, t.contents[0].contents[0].type);
ASSERT_EQ('\\', t.contents[0].contents[0].literal);
regex_free_children(&t);
regex_free(&t);
}
static void a_pipe_b_in_parens_is_parsed_as_subexpr_term(void)
@@ -163,7 +163,7 @@ static void a_pipe_b_in_parens_is_parsed_as_subexpr_term(void)
ASSERT_EQ(REGEX_TERM_LITERAL, inner->contents[1].contents[0].type);
ASSERT_EQ('b', inner->contents[1].contents[0].literal);
regex_free_children(&t);
regex_free(&t);
}
static void a_in_parens_b_is_parsed_as_sequence_with_subexpr_term(void)
@@ -188,7 +188,7 @@ static void a_in_parens_b_is_parsed_as_sequence_with_subexpr_term(void)
ASSERT_EQ(REGEX_TERM_LITERAL, inner->contents[0].contents[0].type);
ASSERT_EQ('a', inner->contents[0].contents[0].literal);
regex_free_children(&t);
regex_free(&t);
}
static void dot_star_is_parsed_as_star_quantified_wildcard(void)
@@ -203,7 +203,7 @@ static void dot_star_is_parsed_as_star_quantified_wildcard(void)
ASSERT_EQ(REGEX_QUANTIFIER_STAR, t.contents[0].contents[0].quantifier);
ASSERT_EQ(REGEX_TERM_WILDCARD, t.contents[0].contents[0].type);
regex_free_children(&t);
regex_free(&t);
}
static void dot_plus_is_parsed_as_plus_quantified_wildcard(void)
@@ -218,7 +218,7 @@ static void dot_plus_is_parsed_as_plus_quantified_wildcard(void)
ASSERT_EQ(REGEX_QUANTIFIER_PLUS, t.contents[0].contents[0].quantifier);
ASSERT_EQ(REGEX_TERM_WILDCARD, t.contents[0].contents[0].type);
regex_free_children(&t);
regex_free(&t);
}
static void dot_question_mark_is_parsed_as_qmrk_quantified_wildcard(void)
@@ -233,7 +233,7 @@ static void dot_question_mark_is_parsed_as_qmrk_quantified_wildcard(void)
ASSERT_EQ(REGEX_QUANTIFIER_QMARK, t.contents[0].contents[0].quantifier);
ASSERT_EQ(REGEX_TERM_WILDCARD, t.contents[0].contents[0].type);
regex_free_children(&t);
regex_free(&t);
}
static void a_in_brackets_is_parsed_as_class_containing_only_a(void)
@@ -252,7 +252,7 @@ static void a_in_brackets_is_parsed_as_class_containing_only_a(void)
ASSERT_NOT_NULL(t.contents[0].contents[0].class.contents);
ASSERT_EQ('a', t.contents[0].contents[0].class.contents[0]);
regex_free_children(&t);
regex_free(&t);
}
static void caret_a_in_brackets_parses_as_negated_class(void)
@@ -271,7 +271,7 @@ static void caret_a_in_brackets_parses_as_negated_class(void)
ASSERT_NOT_NULL(t.contents[0].contents[0].class.contents);
ASSERT_EQ('a', t.contents[0].contents[0].class.contents[0]);
regex_free_children(&t);
regex_free(&t);
}
int main(void)