[pypy-commit] pypy default: Extra tests

arigo noreply at buildbot.pypy.org
Mon Jan 20 15:48:32 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r68786:f64ca9169226
Date: 2014-01-20 15:47 +0100
http://bitbucket.org/pypy/pypy/changeset/f64ca9169226/

Log:	Extra tests

diff --git a/pypy/module/test_lib_pypy/ctypes_tests/support.py b/pypy/module/test_lib_pypy/ctypes_tests/support.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/support.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/support.py
@@ -37,6 +37,8 @@
                 pass
 
     def teardown_class(cls):
+        if not hasattr(sys, 'pypy_translation_info'):
+            return
         if sys.pypy_translation_info['translation.gc'] == 'boehm':
             return # it seems that boehm has problems with __del__, so not
                    # everything is freed
diff --git a/pypy/module/test_lib_pypy/ctypes_tests/test_strings.py b/pypy/module/test_lib_pypy/ctypes_tests/test_strings.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/test_strings.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/test_strings.py
@@ -38,6 +38,16 @@
         buf.raw = "Hello, World"
         assert buf.value == "Hello, World"
 
+    def test_c_buffer_raw_from_buffer(self):
+        buf = c_buffer(32)
+        buf.raw = buffer("Hello, World")
+        assert buf.value == "Hello, World"
+
+    def test_c_buffer_raw_from_memoryview(self):
+        buf = c_buffer(32)
+        buf.raw = memoryview("Hello, World")
+        assert buf.value == "Hello, World"
+
     def test_param_1(self):
         BUF = c_char * 4
         buf = BUF()


More information about the pypy-commit mailing list