Skip to content

Commit 8a9bd88

Browse files
cosmo0920edsiper
authored andcommitted
ml: tests: Add disabling case for multiline truncation
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 7d8da66 commit 8a9bd88

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/internal/multiline.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,29 @@ static void test_buffer_limit_truncation()
15341534
flb_config_exit(config);
15351535
}
15361536

1537+
static void test_buffer_limit_disabled()
1538+
{
1539+
struct flb_config *config;
1540+
struct flb_ml *ml;
1541+
1542+
config = flb_config_init();
1543+
1544+
if (config->multiline_buffer_limit) {
1545+
flb_free(config->multiline_buffer_limit);
1546+
config->multiline_buffer_limit = NULL;
1547+
}
1548+
1549+
config->multiline_buffer_limit = flb_strdup("false");
1550+
1551+
ml = flb_ml_create(config, "limit-disabled");
1552+
TEST_CHECK(ml != NULL);
1553+
1554+
TEST_CHECK(ml->buffer_limit == 0);
1555+
1556+
flb_ml_destroy(ml);
1557+
flb_config_exit(config);
1558+
}
1559+
15371560
TEST_LIST = {
15381561
/* Normal features tests */
15391562
{ "parser_docker", test_parser_docker},
@@ -1546,6 +1569,7 @@ TEST_LIST = {
15461569
{ "container_mix", test_container_mix},
15471570
{ "endswith", test_endswith},
15481571
{ "buffer_limit_truncation", test_buffer_limit_truncation},
1572+
{ "buffer_limit_disabled", test_buffer_limit_disabled},
15491573

15501574
/* Issues reported on Github */
15511575
{ "issue_3817_1" , test_issue_3817_1},

0 commit comments

Comments
 (0)