Skip to content
Snippets Groups Projects
Commit cb66b756 authored by Paul Sokolovsky's avatar Paul Sokolovsky Committed by Damien George
Browse files

tests/unix/ffi_float: Skip if strtof() is not available.

As the case for e.g. Android's Bionic Libc.
parent 34af10d2
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,14 @@ def ffi_open(names): ...@@ -18,7 +18,14 @@ def ffi_open(names):
libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib')) libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))
try:
strtof = libc.func("f", "strtof", "sp") 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)) print('%.6f' % strtof('1.23', None))
strtod = libc.func("d", "strtod", "sp") strtod = libc.func("d", "strtod", "sp")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment