summaryrefslogtreecommitdiff
path: root/tests/unix/ffi_callback.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unix/ffi_callback.py')
-rw-r--r--tests/unix/ffi_callback.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unix/ffi_callback.py b/tests/unix/ffi_callback.py
index 23b058bce..21bfccf25 100644
--- a/tests/unix/ffi_callback.py
+++ b/tests/unix/ffi_callback.py
@@ -15,16 +15,19 @@ def ffi_open(names):
err = e
raise err
-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"))
qsort = libc.func("v", "qsort", "piip")
+
def cmp(pa, pb):
a = ffi.as_bytearray(pa, 1)
b = ffi.as_bytearray(pb, 1)
- #print("cmp:", a, b)
+ # print("cmp:", a, b)
return a[0] - b[0]
+
cmp_c = ffi.callback("i", cmp, "pp")
s = bytearray(b"foobar")