diff options
author | Christopher Haster <chaster@utexas.edu> | 2018-01-29 19:42:45 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2018-01-30 03:37:48 +0300 |
commit | 88f678f4c6e33e6250e102cc87f51e8a358931bb (patch) | |
tree | 9d7dd41464de89bcebee7155ba9e6375b4189efb /tests | |
parent | 3ef4847434bbf9e8224000c3a76fe3dff90ee250 (diff) |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/template.fmt | 2 | ||||
-rwxr-xr-x | tests/test.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/template.fmt b/tests/template.fmt index 85f00bd..4511e6d 100644 --- a/tests/template.fmt +++ b/tests/template.fmt @@ -58,7 +58,7 @@ lfs_size_t size; lfs_size_t wsize; lfs_size_t rsize; -uintmax_t res; +uintmax_t test; #ifndef LFS_READ_SIZE #define LFS_READ_SIZE 16 diff --git a/tests/test.py b/tests/test.py index fcbb826..0a5817d 100755 --- a/tests/test.py +++ b/tests/test.py @@ -14,8 +14,8 @@ def generate(test): match = re.match('(?: *\n)*( *)(.*)=>(.*);', line, re.DOTALL | re.MULTILINE) if match: tab, test, expect = match.groups() - lines.append(tab+'res = {test};'.format(test=test.strip())) - lines.append(tab+'test_assert("{name}", res, {expect});'.format( + lines.append(tab+'test = {test};'.format(test=test.strip())) + lines.append(tab+'test_assert("{name}", test, {expect});'.format( name = re.match('\w*', test.strip()).group(), expect = expect.strip())) else: |