Skip to content

Commit

Permalink
Fix some warnings in test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Aug 10, 2024
1 parent e6d4991 commit ba1d90c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/test_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static void test_alc_dyn(void) {
alc = yyjson_alc_dyn_new();
ptr[0] = alc->malloc(alc->ctx, 0x100);
yy_assert(ptr[0]);
memset(ptr[0], 0x100, 0xFF);
memset(ptr[0], 0xFF, 0x100);
alc->free(alc->ctx, ptr[0]);
yyjson_alc_dyn_free(alc);

Expand All @@ -270,7 +270,7 @@ static void test_alc_dyn(void) {
usize len = yy_rand_u32_uniform(0x4000) + 1;
ptr[0] = alc->malloc(alc->ctx, len);
yy_assert(ptr[0]);
memset(ptr[0], len, 0xFF);
memset(ptr[0], 0xFF, len);
alc->free(alc->ctx, ptr[0]);
}
yyjson_alc_dyn_free(alc);
Expand All @@ -283,7 +283,7 @@ static void test_alc_dyn(void) {
usize len = yy_rand_u32_uniform(0x4000) + 1;
ptr[0] = alc->malloc(alc->ctx, len);
yy_assert(ptr[0]);
memset(ptr[0], len, 0xFF);
memset(ptr[0], 0xFF, len);
alc->free(alc->ctx, ptr[0]);
}
yyjson_alc_dyn_free(alc);
Expand All @@ -297,10 +297,10 @@ static void test_alc_dyn(void) {
usize inc = yy_rand_u32_uniform(0x4000) + 1;
ptr[0] = alc->malloc(alc->ctx, len);
yy_assert(ptr[0]);
memset(ptr[0], len, 0xFF);
memset(ptr[0], 0xFF, len);
ptr[0] = alc->realloc(alc->ctx, ptr[0], len, len + inc);
yy_assert(ptr[0]);
memset(ptr[0], len + inc, 0xFF);
memset(ptr[0], 0xFF, len + inc);
alc->free(alc->ctx, ptr[0]);
}
yyjson_alc_dyn_free(alc);
Expand Down

0 comments on commit ba1d90c

Please sign in to comment.