diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-17 16:21:43 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-17 16:21:43 +0100 |
commit | 5cd0b2227f1c36584129cdce86dd20952b45581c (patch) | |
tree | bef451353a1a0f0a5050fbbd0df8eb550b728278 /tests/basics/math-fun.py | |
parent | d7a4b6903931f9e42686f4c4f3c3c8e9485c143f (diff) | |
download | micropython-5cd0b2227f1c36584129cdce86dd20952b45581c.tar.gz micropython-5cd0b2227f1c36584129cdce86dd20952b45581c.zip |
tests: Split out those tests requiring float and import.
Tests in basics (which should probably be renamed to core) should not
rely on float, or import any non-built-in files. This way these tests
can be run when those features are not available.
All test in basics now pass on the pyboard using stmhal port, except for
string-repr which has some issues with character hex printing.
Diffstat (limited to 'tests/basics/math-fun.py')
-rw-r--r-- | tests/basics/math-fun.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/basics/math-fun.py b/tests/basics/math-fun.py deleted file mode 100644 index 7a37c58454..0000000000 --- a/tests/basics/math-fun.py +++ /dev/null @@ -1,46 +0,0 @@ -# Tests the functions imported from math - -from math import * - -test_values = [-100., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 100.] -p_test_values = [0.1, 0.5, 1.23456] -unit_range_test_values = [-1., -0.75, -0.5, -0.25, 0., 0.25, 0.5, 0.75, 1.] - -functions = [('sqrt', sqrt, p_test_values), - ('exp', exp, test_values), - ('expm1', expm1, test_values), - ('log', log, p_test_values), - ('log2', log2, p_test_values), - ('log10', log10, p_test_values), - ('cosh', cosh, test_values), - ('sinh', sinh, test_values), - ('tanh', tanh, test_values), - ('acosh', acosh, [1.0, 5.0, 1.0]), - ('asinh', asinh, test_values), - ('atanh', atanh, [-0.99, -0.5, 0.0, 0.5, 0.99]), - ('cos', cos, test_values), - ('sin', sin, test_values), - ('tan', tan, test_values), - ('acos', acos, unit_range_test_values), - ('asin', asin, unit_range_test_values), - ('atan', atan, test_values), - ('ceil', ceil, test_values), - ('fabs', fabs, test_values), - ('floor', floor, test_values), - #('frexp', frexp, test_values), - ('trunc', trunc, test_values) - ] - -for function_name, function, test_vals in functions: - print(function_name) - for value in test_vals: - print("{:.7g}".format(function(value))) - -binary_functions = [('copysign', copysign, [(23., 42.), (-23., 42.), (23., -42.), - (-23., -42.), (1., 0.0), (1., -0.0)]) - ] - -for function_name, function, test_vals in binary_functions: - print(function_name) - for value1, value2 in test_vals: - print("{:.7g}".format(function(value1, value2))) |