Author: Antonio Cuni <anto.c...@gmail.com>
Branch: ffistruct
Changeset: r51262:b85af534959c
Date: 2012-01-10 14:45 +0100
http://bitbucket.org/pypy/pypy/changeset/b85af534959c/

Log:    add test for chars and unichars

diff --git a/pypy/module/_ffi/test/test_type_converter.py 
b/pypy/module/_ffi/test/test_type_converter.py
--- a/pypy/module/_ffi/test/test_type_converter.py
+++ b/pypy/module/_ffi/test/test_type_converter.py
@@ -53,6 +53,12 @@
                    r_uint(sys.maxint - 2))
         self.check(app_types.ulong, space.wrap(sys.maxint+12),
                    r_uint(sys.maxint+12))
+        self.check(app_types.ulong, space.wrap(sys.maxint*2+3), r_uint(1))
+
+    def test_char(self):
+        space = self.space
+        self.check(app_types.char, space.wrap('a'), ord('a'))
+        self.check(app_types.unichar, space.wrap(u'\u1234'), 0x1234)
 
     def test_pointer(self):
         # pointers are "unsigned" at applevel, but signed at interp-level (for
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to