mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:32:46 +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:
		
							parent
							
								
									6560116b67
								
							
						
					
					
						commit
						a9a1a5dfa9
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		|  | @ -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) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling