[pypy-svn] r35068 - pypy/dist/pypy/rlib/test

ac at codespeak.net ac at codespeak.net
Tue Nov 28 12:34:42 CET 2006


Author: ac
Date: Tue Nov 28 12:34:41 2006
New Revision: 35068

Modified:
   pypy/dist/pypy/rlib/test/test_rsocket.py
Log:
Work around a bug in ctypes cast function.

Modified: pypy/dist/pypy/rlib/test/test_rsocket.py
==============================================================================
--- pypy/dist/pypy/rlib/test/test_rsocket.py	(original)
+++ pypy/dist/pypy/rlib/test/test_rsocket.py	Tue Nov 28 12:34:41 2006
@@ -205,14 +205,14 @@
     # Test string case
     s = RSocket(AF_INET, SOCK_STREAM)
     reusestr = s.getsockopt(SOL_SOCKET, SO_REUSEADDR, sizeof(c_int))
-    reuseptr = cast(c_char_p(reusestr), POINTER(c_int))
+    reuseptr = cast((c_char*len(reusestr))(*[c for c in reusestr]), POINTER(c_int))
     assert reuseptr[0] == 0
     optval = c_int(1)
     optvalp = cast(pointer(optval), POINTER(c_char))
     optstr = optvalp[:sizeof(c_int)]
     s.setsockopt(SOL_SOCKET, SO_REUSEADDR, optstr)
     reusestr = s.getsockopt(SOL_SOCKET, SO_REUSEADDR, sizeof(c_int))
-    reuseptr = cast(c_char_p(reusestr), POINTER(c_int))
+    reuseptr = cast((c_char*len(reusestr))(*[c for c in reusestr]), POINTER(c_int))
     assert reuseptr[0] != 0
 
 def test_dup():



More information about the Pypy-commit mailing list