Skip to content

Commit

Permalink
Use buddy_can_shrink when testing upsize to detect if any allocation …
Browse files Browse the repository at this point in the history
…has moved up
  • Loading branch information
spaskalev committed Dec 21, 2024
1 parent 3fe577b commit 1a72050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ void test_buddy_resize_multiple(void) {
for (size_t shift = 1; shift <= 9; shift++) {
while (buddy_malloc(buddy, PSS(64))); /* Fill it in */
buddy = buddy_resize(buddy, buddy_size << shift);
assert(buddy_fragmentation(buddy) == 255);
assert(buddy_can_shrink(buddy));
}
free(data_buf);
free(buddy_buf);
Expand Down Expand Up @@ -602,7 +602,7 @@ void test_buddy_resize_embedded_multiple(void) {
for (size_t shift = 1; shift <= 9; shift++) {
while (buddy_malloc(buddy, PSS(64))); /* Fill it in */
buddy = buddy_resize(buddy, buddy_size << shift);
assert(buddy_fragmentation(buddy) == 170);
assert(buddy_can_shrink(buddy));
}
free(data_buf);
}
Expand Down

0 comments on commit 1a72050

Please sign in to comment.