[pypy-commit] pypy py3k: merge heads

amauryfa noreply at buildbot.pypy.org
Fri Apr 26 22:33:38 CEST 2013


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r63668:18cdece25b93
Date: 2013-04-26 22:31 +0200
http://bitbucket.org/pypy/pypy/changeset/18cdece25b93/

Log:	merge heads

diff --git a/pypy/module/_ffi/test/test_funcptr.py b/pypy/module/_ffi/test/test_funcptr.py
--- a/pypy/module/_ffi/test/test_funcptr.py
+++ b/pypy/module/_ffi/test/test_funcptr.py
@@ -113,7 +113,6 @@
                 return x+y;
             }
         """
-        py3k_skip('missing support for longs')
         import sys
         from _ffi import CDLL, types
         libfoo = CDLL(self.libfoo_name)
@@ -195,17 +194,16 @@
                 return len;
             }
         """
-        py3k_skip('missing support for unicode')
         from _ffi import CDLL, types
         import _rawffi
         libfoo = CDLL(self.libfoo_name)
         mystrlen = libfoo.getfunc('mystrlen', [types.char_p], types.slong)
         #
         # first, try automatic conversion from a string
-        assert mystrlen('foobar') == 6
+        assert mystrlen(b'foobar') == 6
         # then, try to pass an explicit pointer
         CharArray = _rawffi.Array('c')
-        mystr = CharArray(7, 'foobar')
+        mystr = CharArray(7, b'foobar')
         assert mystrlen(mystr.buffer) == 6
         mystr.free()
         mystrlen.free_temp_buffers()
@@ -246,16 +244,15 @@
                 return s;
             }
         """
-        py3k_skip('missing support for unicode')
         from _ffi import CDLL, types
         import _rawffi
         libfoo = CDLL(self.libfoo_name)
         do_nothing = libfoo.getfunc('do_nothing', [types.char_p], types.char_p)
         CharArray = _rawffi.Array('c')
         #
-        ptr = do_nothing('foobar')
+        ptr = do_nothing(b'foobar')
         array = CharArray.fromaddress(ptr, 7)
-        assert list(array) == list('foobar\00')
+        assert bytes(array) == b'foobar\00'
         do_nothing.free_temp_buffers()
 
     def test_typed_pointer_args(self):
@@ -295,7 +292,6 @@
                 return x+y;
             }
         """
-        py3k_skip('missing support for longs')
         import sys
         from _ffi import CDLL, types
         libfoo = CDLL(self.libfoo_name)
@@ -438,7 +434,6 @@
                 return x+y;
             }
         """
-        py3k_skip('missing support for ulonglong')
         from _ffi import CDLL, types
         maxint64 = 9223372036854775807 # maxint64+1 does not fit into a
                                        # longlong, but it does into a
diff --git a/pypy/module/_multiprocessing/test/test_memory.py b/pypy/module/_multiprocessing/test/test_memory.py
--- a/pypy/module/_multiprocessing/test/test_memory.py
+++ b/pypy/module/_multiprocessing/test/test_memory.py
@@ -8,7 +8,6 @@
         raises(TypeError, _multiprocessing.address_of_buffer, "a")
 
     def test_mmap_address(self):
-        py3k_skip('ctypes not working yet')
         import mmap
         import _multiprocessing
 
@@ -19,7 +18,7 @@
         sizeof_double = _ctypes.sizeof(c_double)
 
         buf = mmap.mmap(-1, 300)
-        buf[0:300] = '\0' * 300
+        buf[0:300] = b'\0' * 300
 
         # Get the address of shared memory
         address, length = _multiprocessing.address_of_buffer(buf)
@@ -27,11 +26,11 @@
 
         # build a ctypes object from it
         var = c_double.from_address(address)
-        assert buf[0:sizeof_double] == '\0' * sizeof_double
+        assert buf[0:sizeof_double] == b'\0' * sizeof_double
         assert var.value == 0
 
         # check that both objects share the same memory
         var.value = 123.456
-        assert buf[0:sizeof_double] != '\0' * sizeof_double
-        buf[0:sizeof_double] = '\0' * sizeof_double
+        assert buf[0:sizeof_double] != b'\0' * sizeof_double
+        buf[0:sizeof_double] = b'\0' * sizeof_double
         assert var.value == 0
diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py
--- a/pypy/module/_rawffi/test/test__rawffi.py
+++ b/pypy/module/_rawffi/test/test__rawffi.py
@@ -557,7 +557,6 @@
         raises(ValueError, "_rawffi.Array('xx')")
 
     def test_longs_ulongs(self):
-        py3k_skip('fails on 32bit')
         import _rawffi
         lib = _rawffi.CDLL(self.lib_name)
         some_huge_value = lib.ptr('some_huge_value', [], 'q')
@@ -610,7 +609,6 @@
         cb.free()
 
     def test_another_callback(self):
-        py3k_skip('fails on 32bit')
         import _rawffi
         lib = _rawffi.CDLL(self.lib_name)
         runcallback = lib.ptr('runcallback', ['P'], 'q')
@@ -776,7 +774,6 @@
         a.free()
 
     def test_truncate(self):
-        py3k_skip('int vs long')
         import _rawffi, struct
         a = _rawffi.Array('b')(1)
         a[0] = -5


More information about the pypy-commit mailing list