[pypy-commit] cffi default: Extra tests

arigo pypy.commits at gmail.com
Sat Sep 15 17:38:41 EDT 2018


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r3161:5fc6cdbc1cf6
Date: 2018-09-15 23:38 +0200
http://bitbucket.org/cffi/cffi/changeset/5fc6cdbc1cf6/

Log:	Extra tests

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -347,6 +347,16 @@
         assert newp(pp, max)[0] == max
         py.test.raises(OverflowError, newp, pp, min - 1)
         py.test.raises(OverflowError, newp, pp, max + 1)
+        py.test.raises(OverflowError, newp, pp, min - 1 - 2 ** 32)
+        py.test.raises(OverflowError, newp, pp, min - 1 - 2 ** 64)
+        py.test.raises(OverflowError, newp, pp, min - 1 + 2 ** 32)
+        py.test.raises(OverflowError, newp, pp, min - 1 + 2 ** 64)
+        py.test.raises(OverflowError, newp, pp, max + 1)
+        py.test.raises(OverflowError, newp, pp, max + 1 - 2 ** 32)
+        py.test.raises(OverflowError, newp, pp, max + 1 - 2 ** 64)
+        py.test.raises(OverflowError, newp, pp, max + 1 + 2 ** 32)
+        py.test.raises(OverflowError, newp, pp, max + 1 + 2 ** 64)
+        py.test.raises(TypeError, newp, pp, 1.0)
     for name in ['char', 'short', 'int', 'long', 'long long']:
         p = new_primitive_type('unsigned ' + name)
         pp = new_pointer_type(p)


More information about the pypy-commit mailing list