mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Add a test for iterating a HashTable during clear (should assert)
Ideally we should also verify that the assertion actually happens, but we need some support in the TestSuite framework for that.
This commit is contained in:
@@ -62,4 +62,18 @@ TEST_CASE(case_insensitive)
|
||||
EXPECT_EQ(casemap.size(), 1);
|
||||
}
|
||||
|
||||
TEST_CASE(assert_on_iteration_during_clear)
|
||||
{
|
||||
struct Object {
|
||||
~Object()
|
||||
{
|
||||
m_map->begin();
|
||||
}
|
||||
HashMap<int, Object>* m_map;
|
||||
};
|
||||
HashMap<int, Object> map;
|
||||
map.set(0, { &map });
|
||||
map.clear();
|
||||
}
|
||||
|
||||
TEST_MAIN(HashMap)
|
||||
|
||||
Reference in New Issue
Block a user