From 1a72050851cb00052243c334385c2b89525550c2 Mon Sep 17 00:00:00 2001 From: Stanislav Paskalev Date: Sat, 21 Dec 2024 18:56:16 +0200 Subject: [PATCH] Use buddy_can_shrink when testing upsize to detect if any allocation has moved up --- tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests.c b/tests.c index 7de5d94..2c1e4a4 100644 --- a/tests.c +++ b/tests.c @@ -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); @@ -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); }