mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	Fixed self-assign warning in tests
Some of the tests were creating a variable `res`, however the test system itself relies on it's own `res` variable. This worked out by luck, but could lead to problems if the res variables were different types. Changed the generated variable in the test system to the less common name `test`, which also works out to share the same prefix as other test functions.
This commit is contained in:
		| @@ -58,7 +58,7 @@ lfs_size_t size; | |||||||
| lfs_size_t wsize; | lfs_size_t wsize; | ||||||
| lfs_size_t rsize; | lfs_size_t rsize; | ||||||
|  |  | ||||||
| uintmax_t res; | uintmax_t test; | ||||||
|  |  | ||||||
| #ifndef LFS_READ_SIZE | #ifndef LFS_READ_SIZE | ||||||
| #define LFS_READ_SIZE 16 | #define LFS_READ_SIZE 16 | ||||||
|   | |||||||
| @@ -14,8 +14,8 @@ def generate(test): | |||||||
|         match = re.match('(?: *\n)*( *)(.*)=>(.*);', line, re.DOTALL | re.MULTILINE) |         match = re.match('(?: *\n)*( *)(.*)=>(.*);', line, re.DOTALL | re.MULTILINE) | ||||||
|         if match: |         if match: | ||||||
|             tab, test, expect = match.groups() |             tab, test, expect = match.groups() | ||||||
|             lines.append(tab+'res = {test};'.format(test=test.strip())) |             lines.append(tab+'test = {test};'.format(test=test.strip())) | ||||||
|             lines.append(tab+'test_assert("{name}", res, {expect});'.format( |             lines.append(tab+'test_assert("{name}", test, {expect});'.format( | ||||||
|                     name = re.match('\w*', test.strip()).group(), |                     name = re.match('\w*', test.strip()).group(), | ||||||
|                     expect = expect.strip())) |                     expect = expect.strip())) | ||||||
|         else: |         else: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user