mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Speed up the generation of storage format test cases
First build a list of all keys, then construct all the corresponding test cases. This allows all required information to be obtained in one go, which is a significant performance gain as the information includes numerical values obtained by compiling a C program. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		
							parent
							
								
									4d0b089d2a
								
							
						
					
					
						commit
						3c9d423fe7
					
				@ -377,11 +377,15 @@ class StorageFormat:
 | 
			
		||||
 | 
			
		||||
    def all_test_cases(self) -> Iterator[test_case.TestCase]:
 | 
			
		||||
        """Generate all storage format test cases."""
 | 
			
		||||
        for key in self.all_keys_for_usage_flags():
 | 
			
		||||
            yield self.make_test_case(key)
 | 
			
		||||
        for key in self.all_keys_for_types():
 | 
			
		||||
            yield self.make_test_case(key)
 | 
			
		||||
        for key in self.all_keys_for_algorithms():
 | 
			
		||||
        # First build a list of all keys, then construct all the corresponding
 | 
			
		||||
        # test cases. This allows all required information to be obtained in
 | 
			
		||||
        # one go, which is a significant performance gain as the information
 | 
			
		||||
        # includes numerical values obtained by compiling a C program.
 | 
			
		||||
        keys = [] #type: List[StorageKey]
 | 
			
		||||
        keys += self.all_keys_for_usage_flags()
 | 
			
		||||
        keys += self.all_keys_for_types()
 | 
			
		||||
        keys += self.all_keys_for_algorithms()
 | 
			
		||||
        for key in keys:
 | 
			
		||||
            yield self.make_test_case(key)
 | 
			
		||||
        # To do: vary id, lifetime
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user