mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
AK: Add test for unbounded HashTable capacity leak
This commit is contained in:
parent
9d8da1697e
commit
455224d476
1 changed files with 10 additions and 0 deletions
|
@ -224,3 +224,13 @@ TEST_CASE(basic_contains)
|
|||
EXPECT_EQ(table.remove(1), true);
|
||||
EXPECT_EQ(table.contains(1), false);
|
||||
}
|
||||
|
||||
TEST_CASE(capacity_leak)
|
||||
{
|
||||
HashTable<int> table;
|
||||
for (size_t i = 0; i < 10000; ++i) {
|
||||
table.set(i);
|
||||
table.remove(i);
|
||||
}
|
||||
EXPECT(table.capacity() < 100u);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue