mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/pkg_libfixmath: fix PEP8 issues
This commit is contained in:
parent
19917f18b7
commit
326f5f1d12
@ -78,12 +78,16 @@ def main():
|
||||
abs_error = abs(res_locals['result'] - float(res_locals['expected']))
|
||||
res_locals['result'] = '{:.4f}'.format(res_locals['result'])
|
||||
if abs_error > ABS_ERROR_LIMIT:
|
||||
print('{}: {} != {}, {:.4f} > {}'.format(res_locals['input'], res_locals['result'], res_locals['expected'],
|
||||
abs_error, ABS_ERROR_LIMIT))
|
||||
print('{}: {} != {}, {:.4f} > {}'.format(
|
||||
res_locals['input'],
|
||||
res_locals['result'],
|
||||
res_locals['expected'],
|
||||
abs_error,
|
||||
ABS_ERROR_LIMIT))
|
||||
errors += 1
|
||||
except:
|
||||
except Exception as exc:
|
||||
errors += 1
|
||||
print('ERROR {}'.format(line))
|
||||
print('ERROR: {}: {}'.format(line, exc))
|
||||
|
||||
print('{} calculations passed.'.format(total - errors))
|
||||
if errors:
|
||||
|
@ -7,26 +7,26 @@ from testrunner import run, test_utils_interactive_sync
|
||||
def expect_unary(child):
|
||||
for _ in range(20):
|
||||
for op_name in ('abs', 'sq', 'atan', 'exp'):
|
||||
child.expect('{}\(-?\d+\.\d+\) = -?\d+\.\d+'.format(op_name))
|
||||
child.expect(r'{}\(-?\d+\.\d+\) = -?\d+\.\d+'.format(op_name))
|
||||
|
||||
for _ in range(20):
|
||||
for op_name in ('sin', 'cos', 'tan'):
|
||||
child.expect('{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name))
|
||||
child.expect(r'{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name))
|
||||
|
||||
for _ in range(20):
|
||||
for op_name in ('asin', 'acos'):
|
||||
child.expect('{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name))
|
||||
child.expect(r'{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name))
|
||||
|
||||
for _ in range(20):
|
||||
for op_name in ('sqrt', 'log', 'log2', 'slog2'):
|
||||
child.expect('{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name))
|
||||
child.expect(r'{}\(-?\d+.\d+\) = -?\d+.\d+'.format(op_name))
|
||||
|
||||
|
||||
def expect_binary(child):
|
||||
for _ in range(1500):
|
||||
for op_name in ('add', 'sub', 'mul', 'div', 'mod', 'sadd', 'ssub',
|
||||
'smul', 'sdiv', 'min', 'max'):
|
||||
child.expect('{}\(-?\d+.\d+\, -?\d+.\d+\) = -?\d+.\d+'
|
||||
child.expect(r'{}\(-?\d+.\d+\, -?\d+.\d+\) = -?\d+.\d+'
|
||||
.format(op_name))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user