Skip to content

Commit ab28d38

Browse files
committed
[libc] Fix forward freestore test on riscv32
1 parent 7553fb1 commit ab28d38

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libc/test/src/__support/freestore_test.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ TEST(LlvmLibcFreeStore, RemoveBestFit) {
7373
ASSERT_EQ(store.remove_best_fit(largest_small->inner_size()), largest_small);
7474
store.insert(largest_small);
7575

76-
// Search smallest for best fit.
77-
ASSERT_EQ(store.remove_best_fit(smallest->inner_size() + 1), largest_small);
78-
store.insert(largest_small);
76+
// Search small list for best fit.
77+
Block<> *next_smallest =
78+
largest_small == smallest ? remainder : largest_small;
79+
ASSERT_EQ(store.remove_best_fit(smallest->inner_size() + 1), next_smallest);
80+
store.insert(next_smallest);
7981

8082
// Continue search for best fit to large blocks.
8183
EXPECT_EQ(store.remove_best_fit(largest_small->inner_size() + 1), remainder);

0 commit comments

Comments
 (0)