[pypy-commit] cffi default: Skip more things when running on py.py, because the 'c_longdouble'

arigo noreply at buildbot.pypy.org
Wed Aug 1 14:49:06 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r758:e848573161d5
Date: 2012-08-01 14:48 +0200
http://bitbucket.org/cffi/cffi/changeset/e848573161d5/

Log:	Skip more things when running on py.py, because the 'c_longdouble'
	type doesn't always work (or is missing)

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1745,18 +1745,21 @@
     assert float(x) == 12.5
 
 def test_longdouble():
+    py_py = 'PY_DOT_PY' in globals()
     BLongDouble = new_primitive_type("long double")
     BLongDoublePtr = new_pointer_type(BLongDouble)
     BLongDoubleArray = new_array_type(BLongDoublePtr, None)
     a = newp(BLongDoubleArray, 1)
     x = a[0]
-    assert repr(x).startswith("<cdata 'long double' 0.0")
+    if not py_py:
+        assert repr(x).startswith("<cdata 'long double' 0.0")
     assert float(x) == 0.0
     assert int(x) == 0
     #
     b = newp(BLongDoubleArray, [1.23])
     x = b[0]
-    assert repr(x).startswith("<cdata 'long double' 1.23")
+    if not py_py:
+        assert repr(x).startswith("<cdata 'long double' 1.23")
     assert float(x) == 1.23
     assert int(x) == 1
     #
@@ -1766,11 +1769,12 @@
     for i in range(107):
         start = f(start)
     if sizeof(BLongDouble) > sizeof(new_primitive_type("double")):
-        if 'PY_DOT_PY' in globals(): py.test.skip('py.py: long double->double')
-        assert repr(start).startswith("<cdata 'long double' 6.15")
-        assert repr(start).endswith("E+902>")
+        if not py_py:
+            assert repr(start).startswith("<cdata 'long double' 6.15")
+            assert repr(start).endswith("E+902>")
         #
         c = newp(BLongDoubleArray, [start])
         x = c[0]
-        assert repr(x).endswith("E+902>")
-        assert float(x) == float("inf")
+        if not py_py:
+            assert repr(x).endswith("E+902>")
+            assert float(x) == float("inf")


More information about the pypy-commit mailing list