Author: Matti Picus <[email protected]>
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
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit