Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r67564:214bfa391b33
Date: 2013-10-24 11:52 +0200
http://bitbucket.org/pypy/pypy/changeset/214bfa391b33/
Log: merge
diff --git a/pypy/module/_cffi_backend/test/test_fastpath.py
b/pypy/module/_cffi_backend/test/test_fastpath.py
--- a/pypy/module/_cffi_backend/test/test_fastpath.py
+++ b/pypy/module/_cffi_backend/test/test_fastpath.py
@@ -105,6 +105,18 @@
assert float(buf[0]) == 1.25
assert float(buf[1]) == -3.5
+ def test_fast_init_bool_from_list(self):
+ import _cffi_backend
+ BOOL = _cffi_backend.new_primitive_type('_Bool')
+ P_BOOL = _cffi_backend.new_pointer_type(BOOL)
+ BOOL_ARRAY = _cffi_backend.new_array_type(P_BOOL, None)
+ buf = _cffi_backend.newp(BOOL_ARRAY, [1, 0])
+ assert buf[0] == 1
+ assert buf[1] == 0
+ assert type(buf[1]) is int
+ raises(OverflowError, _cffi_backend.newp, BOOL_ARRAY, [2])
+ raises(OverflowError, _cffi_backend.newp, BOOL_ARRAY, [-1])
+
class AppTest_fast_path_bug(object):
spaceconfig = dict(usemodules=('_cffi_backend', 'cStringIO'))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit