Skip to content

Commit

Permalink
tests: internal: parser: adjusto to updated parser API for system tim…
Browse files Browse the repository at this point in the history
…ezone

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
braydonk authored and edsiper committed Jun 25, 2024
1 parent e81fc39 commit b857ac7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/internal/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void test_parser_time_lookup()
continue;
}

epoch = flb_parser_tm2time(&tm);
epoch = flb_parser_tm2time(&tm, FLB_FALSE);
epoch -= year_diff;
TEST_CHECK(t->epoch == epoch);
TEST_CHECK(t->frac_seconds == ns);
Expand Down
12 changes: 6 additions & 6 deletions tests/internal/parser_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void test_basic()
}

parser = flb_parser_create("json", "json", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -223,7 +223,7 @@ void test_time_key()
}

parser = flb_parser_create("json", "json", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -284,7 +284,7 @@ void test_time_keep()
}

parser = flb_parser_create("json", "json", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -365,7 +365,7 @@ void test_types_is_not_supported()
types->type = FLB_PARSER_TYPE_HEX;

parser = flb_parser_create("json", "json", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
types, 1, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -450,7 +450,7 @@ void test_decode_field_json()
}

parser = flb_parser_create("json", "json", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, decoder, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -505,7 +505,7 @@ void test_time_key_kept_if_parse_fails()
}

parser = flb_parser_create("json", "json", NULL, FLB_FALSE, time_format, "time", NULL,
FLB_FALSE, FLB_TRUE, FLB_FALSE,
FLB_FALSE, FLB_TRUE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down
8 changes: 4 additions & 4 deletions tests/internal/parser_logfmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void test_basic()
}

parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -223,7 +223,7 @@ void test_time_key()
}

parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -284,7 +284,7 @@ void test_time_keep()
}

parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -361,7 +361,7 @@ void test_types()
types->type = FLB_PARSER_TYPE_HEX;

parser = flb_parser_create("logfmt", "logfmt", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
types, 1, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down
10 changes: 5 additions & 5 deletions tests/internal/parser_ltsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void test_basic()
}

parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -223,7 +223,7 @@ void test_time_key()
}

parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -284,7 +284,7 @@ void test_time_keep()
}

parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -361,7 +361,7 @@ void test_types()
types->type = FLB_PARSER_TYPE_HEX;

parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
types, 1, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -446,7 +446,7 @@ void test_decode_field_json()
}

parser = flb_parser_create("ltsv", "ltsv", NULL, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, decoder, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down
10 changes: 5 additions & 5 deletions tests/internal/parser_regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void test_basic()
}

parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -225,7 +225,7 @@ void test_time_key()
}

parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -287,7 +287,7 @@ void test_time_keep()
}

parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, "%Y-%m-%dT%H:%M:%S.%L", "time", NULL,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE,
FLB_TRUE /*time_keep */, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -365,7 +365,7 @@ void test_types()
types->type = FLB_PARSER_TYPE_HEX;

parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
types, 1, NULL, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down Expand Up @@ -451,7 +451,7 @@ void test_decode_field_json()
}

parser = flb_parser_create("regex", "regex", regex, FLB_FALSE, NULL, NULL, NULL,
FLB_FALSE, FLB_FALSE, FLB_FALSE,
FLB_FALSE, FLB_FALSE, FLB_FALSE, FLB_FALSE,
NULL, 0, decoder, config);
if (!TEST_CHECK(parser != NULL)) {
TEST_MSG("flb_parser_create failed");
Expand Down

0 comments on commit b857ac7

Please sign in to comment.