Skip to content

Commit cb66b75

Browse files
pfalcondpgeorge
authored andcommitted
tests/unix/ffi_float: Skip if strtof() is not available.
As the case for e.g. Android's Bionic Libc.
1 parent 34af10d commit cb66b75

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/unix/ffi_float.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ def ffi_open(names):
1818

1919
libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))
2020

21-
strtof = libc.func("f", "strtof", "sp")
21+
try:
22+
strtof = libc.func("f", "strtof", "sp")
23+
except OSError:
24+
# Some libc's (e.g. Android's Bionic) define strtof as macro/inline func
25+
# in terms of strtod().
26+
print("SKIP")
27+
raise SystemExit
28+
2229
print('%.6f' % strtof('1.23', None))
2330

2431
strtod = libc.func("d", "strtod", "sp")

0 commit comments

Comments
 (0)