Author: Antonio Cuni <[email protected]>
Branch: ffistruct
Changeset: r51261:0429f19a7321
Date: 2012-01-10 14:20 +0100
http://bitbucket.org/pypy/pypy/changeset/0429f19a7321/
Log: test conversion to unsigned long
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
@@ -45,11 +45,14 @@
self.check(app_types.sint, self.space.wrap(sys.maxint+1),
-sys.maxint-1)
self.check(app_types.sint, self.space.wrap(sys.maxint*2), -2)
- def test_uint(self):
- self.check(app_types.uint, self.space.wrap(42), r_uint(42))
- self.check(app_types.uint, self.space.wrap(-1), r_uint(sys.maxint*2
+1))
- self.check(app_types.uint, self.space.wrap(sys.maxint*3),
+ def test_unsigned(self):
+ space = self.space
+ self.check(app_types.uint, space.wrap(42), r_uint(42))
+ self.check(app_types.uint, space.wrap(-1), r_uint(sys.maxint*2 +1))
+ self.check(app_types.uint, space.wrap(sys.maxint*3),
r_uint(sys.maxint - 2))
+ self.check(app_types.ulong, space.wrap(sys.maxint+12),
+ r_uint(sys.maxint+12))
def test_pointer(self):
# pointers are "unsigned" at applevel, but signed at interp-level (for
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit