Author: Armin Rigo <[email protected]>
Branch:
Changeset: r582:719d69b87f28
Date: 2012-07-06 11:37 +0200
http://bitbucket.org/cffi/cffi/changeset/719d69b87f28/
Log: Speed up this test on py.py.
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -867,14 +867,17 @@
assert f(max) == 42
def test_a_lot_of_callbacks():
+ BIGNUM = 10000
+ if hasattr(sys, 'pypy_objspaceclass'): BIGNUM = 100 # tests on py.py
+ #
BInt = new_primitive_type("int")
+ BFunc = new_function_type((BInt,), BInt, False)
def make_callback(m):
def cb(n):
return n + m
- BFunc = new_function_type((BInt,), BInt, False)
return callback(BFunc, cb, 42) # 'cb' and 'BFunc' go out of scope
#
- flist = [make_callback(i) for i in range(10000)]
+ flist = [make_callback(i) for i in range(BIGNUM)]
for i, f in enumerate(flist):
assert f(-142) == -142 + i
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit