diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2018-09-11 00:40:41 +0300 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-10-05 16:49:32 +1000 |
commit | cb66b75692225914bacc1b5f4e32967d37f9cf9d (patch) | |
tree | c523d52809b240b781c107692fbf5cf928a554a1 | |
parent | 34af10d2ef545ecaf2c1824dac679af39d683e98 (diff) | |
download | micropython-cb66b75692225914bacc1b5f4e32967d37f9cf9d.tar.gz micropython-cb66b75692225914bacc1b5f4e32967d37f9cf9d.zip |
tests/unix/ffi_float: Skip if strtof() is not available.
As the case for e.g. Android's Bionic Libc.
-rw-r--r-- | tests/unix/ffi_float.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unix/ffi_float.py b/tests/unix/ffi_float.py index c92a39bcdc..317436855b 100644 --- a/tests/unix/ffi_float.py +++ b/tests/unix/ffi_float.py @@ -18,7 +18,14 @@ def ffi_open(names): libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib')) -strtof = libc.func("f", "strtof", "sp") +try: + strtof = libc.func("f", "strtof", "sp") +except OSError: + # Some libc's (e.g. Android's Bionic) define strtof as macro/inline func + # in terms of strtod(). + print("SKIP") + raise SystemExit + print('%.6f' % strtof('1.23', None)) strtod = libc.func("d", "strtod", "sp") |