Initialize everything explicitly in parser
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
static void a_has_no_alternative(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("a", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
ASSERT_NULL(r.alternative);
|
||||
@@ -19,7 +19,7 @@ static void a_has_no_alternative(void)
|
||||
|
||||
static void a_pipe_b_has_alternative(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("a|b", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
ASSERT_NOT_NULL(r.alternative);
|
||||
@@ -28,7 +28,7 @@ static void a_pipe_b_has_alternative(void)
|
||||
|
||||
static void a_pipe_b_pipe_c_result_alternative_has_alternative(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("a|b|c", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
ASSERT_NOT_NULL(r.alternative);
|
||||
@@ -38,7 +38,7 @@ static void a_pipe_b_pipe_c_result_alternative_has_alternative(void)
|
||||
|
||||
static void a_is_parsed_as_unquantified_literal(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("a", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -52,7 +52,7 @@ static void a_is_parsed_as_unquantified_literal(void)
|
||||
|
||||
static void b_is_parsed_as_unquantified_literal(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("b", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -66,7 +66,7 @@ static void b_is_parsed_as_unquantified_literal(void)
|
||||
|
||||
static void abc_is_parsed_as_sequence_of_unquantified_literals(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("abc", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -86,7 +86,7 @@ static void abc_is_parsed_as_sequence_of_unquantified_literals(void)
|
||||
|
||||
static void dot_is_parsed_as_unquantified_wildcard_term(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING(".", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -99,7 +99,7 @@ static void dot_is_parsed_as_unquantified_wildcard_term(void)
|
||||
|
||||
static void backslash_dot_is_parsed_as_unquantified_literal(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("\\.", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -113,7 +113,7 @@ static void backslash_dot_is_parsed_as_unquantified_literal(void)
|
||||
|
||||
static void backslash_backslash_is_parsed_as_unquantified_literal(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("\\\\", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -127,7 +127,7 @@ static void backslash_backslash_is_parsed_as_unquantified_literal(void)
|
||||
|
||||
static void a_pipe_b_in_parens_is_parsed_as_regex_term(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("(a|b)", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -152,7 +152,7 @@ static void a_pipe_b_in_parens_is_parsed_as_regex_term(void)
|
||||
|
||||
static void a_in_parens_b_is_parsed_as_sequence_with_regex_term(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("(a)b", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -174,7 +174,7 @@ static void a_in_parens_b_is_parsed_as_sequence_with_regex_term(void)
|
||||
|
||||
static void dot_star_is_parsed_as_zero_or_more_wildcard(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING(".*", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -187,7 +187,7 @@ static void dot_star_is_parsed_as_zero_or_more_wildcard(void)
|
||||
|
||||
static void dot_plus_is_parsed_as_one_or_more_wildcard(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING(".+", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -200,7 +200,7 @@ static void dot_plus_is_parsed_as_one_or_more_wildcard(void)
|
||||
|
||||
static void dot_question_mark_is_parsed_as_zero_or_one_wildcard(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING(".?", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -213,7 +213,7 @@ static void dot_question_mark_is_parsed_as_zero_or_one_wildcard(void)
|
||||
|
||||
static void a_in_brackets_is_parsed_as_class_containing_only_a(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("[a]", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
@@ -230,7 +230,7 @@ static void a_in_brackets_is_parsed_as_class_containing_only_a(void)
|
||||
|
||||
static void caret_a_in_brackets_parses_as_negated_class(void)
|
||||
{
|
||||
regex_t r = { 0 };
|
||||
regex_t r;
|
||||
const int result = PARSE_REGEX_STRING("[^a]", &r);
|
||||
ASSERT_NE(-1, result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user