mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 19:20:40 -04:00 
			
		
		
		
	Simplify code
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
		
							parent
							
								
									95180fe808
								
							
						
					
					
						commit
						35929ebb72
					
				| @ -364,7 +364,7 @@ class StorageFormat: | |||||||
|         usage = ' | '.join(usage_flags) if usage_flags else '0' |         usage = ' | '.join(usage_flags) if usage_flags else '0' | ||||||
|         if short is None: |         if short is None: | ||||||
|             short = re.sub(r'\bPSA_KEY_USAGE_', r'', usage) |             short = re.sub(r'\bPSA_KEY_USAGE_', r'', usage) | ||||||
|         extra_desc = ' ' + extra_desc if extra_desc is not None and len(extra_desc) > 0 else '' |         extra_desc = ' ' + extra_desc if extra_desc else '' | ||||||
|         description = 'usage' + extra_desc + ': ' + short |         description = 'usage' + extra_desc + ': ' + short | ||||||
|         return self.key_builder.build(version=self.version, |         return self.key_builder.build(version=self.version, | ||||||
|                                       id=1, lifetime=0x00000001, |                                       id=1, lifetime=0x00000001, | ||||||
| @ -481,14 +481,12 @@ class StorageFormat: | |||||||
|         # test cases. This allows all required information to be obtained in |         # test cases. This allows all required information to be obtained in | ||||||
|         # one go, which is a significant performance gain as the information |         # one go, which is a significant performance gain as the information | ||||||
|         # includes numerical values obtained by compiling a C program. |         # includes numerical values obtained by compiling a C program. | ||||||
|         generated_keys = self.generate_all_keys() |         keys = self.generate_all_keys() | ||||||
| 
 | 
 | ||||||
|         # Skip keys with a non-default location, because they |         # Skip keys with a non-default location, because they | ||||||
|         # require a driver and we currently have no mechanism to |         # require a driver and we currently have no mechanism to | ||||||
|         # determine whether a driver is available. |         # determine whether a driver is available. | ||||||
|         keys = filter(lambda key: key.location_value() == 0, generated_keys) |         return [self.make_test_case(key) for key in keys if key.location_value() == 0] | ||||||
| 
 |  | ||||||
|         return [self.make_test_case(key) for key in keys] |  | ||||||
| 
 | 
 | ||||||
| class StorageFormatForward(StorageFormat): | class StorageFormatForward(StorageFormat): | ||||||
|     """Storage format stability test cases for forward compatibility.""" |     """Storage format stability test cases for forward compatibility.""" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 gabor-mezei-arm
						gabor-mezei-arm