[pypy-commit] pypy default: add failing ctypes test that causes socket.sendall() failure
mattip
pypy.commits at gmail.com
Thu Aug 15 02:46:01 EDT 2019
Author: Matti Picus <matti.picus at gmail.com>
Branch:
Changeset: r97181:9920d591bb29
Date: 2019-08-14 19:39 +0300
http://bitbucket.org/pypy/pypy/changeset/9920d591bb29/
Log: add failing ctypes test that causes socket.sendall() failure
diff --git a/extra_tests/ctypes_tests/test_cast.py b/extra_tests/ctypes_tests/test_cast.py
--- a/extra_tests/ctypes_tests/test_cast.py
+++ b/extra_tests/ctypes_tests/test_cast.py
@@ -28,3 +28,11 @@
assert x.value is False
x = c_bool(['yadda'])
assert x.value is True
+
+def test_cast_array():
+ data = b'data'
+ ubyte = c_ubyte * len(data)
+ byteslike = ubyte.from_buffer_copy(data)
+ m = memoryview(byteslike)
+ b = m.cast('B')
+ assert bytes(b) == data
More information about the pypy-commit
mailing list