[pypy-commit] pypy ffistruct: test conversion to unsigned long
antocuni
noreply at buildbot.pypy.org
Thu Jan 12 14:28:17 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
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
More information about the pypy-commit
mailing list