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

As the case for e.g. Android's Bionic Libc.
pull/4197/merge
Paul Sokolovsky 2018-09-11 00:40:41 +03:00 zatwierdzone przez Damien George
rodzic 34af10d2ef
commit cb66b75692
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -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")