Skip to content

Commit

Permalink
ADD dummy test
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 committed Jul 16, 2023
1 parent 1688891 commit d693133
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/internal/log_event_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,33 @@ static void emit_raw_record()
flb_log_event_encoder_destroy(&encoder);
}

void dummy()
{
void *data = NULL;
size_t alloc = 8192;
size_t size = 6;
size_t nsize = 16384;
size_t len = 4;
void *tmp;

printf("A:sbuf->alloc=%ld sbuf->size=%ld len=%ld nsize=%ld\n", alloc, size, len, nsize);
while(nsize < size + len) {
size_t tmp_nsize = nsize * 2;
if (tmp_nsize <= nsize) {
nsize = size + len;
break;
}
nsize = tmp_nsize;
}
printf("B:sbuf->alloc=%ld sbuf->size=%ld len=%ld nsize=%ld\n",alloc, size, len, nsize);
tmp = realloc(data, nsize);
if (!tmp) {
printf("C:sbuf->alloc=%ld sbuf->size=%ld len=%ld nsize=%ld\n",alloc, size, len, nsize);
return;
}
free(tmp);
}

TEST_LIST = {
{ "basic_format_fluent_bit_v2", basic_format_fluent_bit_v2},
{ "basic_format_fluent_bit_v1", basic_format_fluent_bit_v1},
Expand All @@ -659,5 +686,6 @@ TEST_LIST = {
{ "init_destroy", init_destroy},
{ "init_unsupported_format", init_unsupported_format},
{ "emit_raw_record", emit_raw_record},
{ "DUMMY", dummy},
{ NULL, NULL }
};

0 comments on commit d693133

Please sign in to comment.