Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Tests/AK/TestJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,10 @@ TEST_CASE(json_array_ensure_capacity)
auto array = setup_json_array();
size_t new_capacity { 16 };
array.ensure_capacity(new_capacity);
EXPECT_EQ(array.values().capacity(), new_capacity);
// The allocator may round up the capacity to a larger value that is
// efficient for its internal bookkeeping (e.g. mimalloc's mi_good_size),
// so we only require that the resulting capacity is at least new_capacity.
EXPECT_GE(array.values().capacity(), new_capacity);
}

TEST_CASE(json_array_for_each)
Expand Down
Loading