[pypy-commit] creflect default: add passing tests

arigo noreply at buildbot.pypy.org
Thu Dec 4 13:30:59 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r149:bee544ef3a06
Date: 2014-12-04 13:31 +0100
http://bitbucket.org/cffi/creflect/changeset/bee544ef3a06/

Log:	add passing tests

diff --git a/zeffir/test/ctype.crx b/zeffir/test/ctype.crx
--- a/zeffir/test/ctype.crx
+++ b/zeffir/test/ctype.crx
@@ -1,9 +1,14 @@
 typedef long long foo_t;
-
+typedef char rfoo_t;
+typedef long double bar_t;
+typedef float rbar_t;
 
 
 // CREFLECT: start
 
 typedef int foo_t;
+typedef long long rfoo_t;
+typedef float bar_t;
+typedef long double rbar_t;
 
 // CREFLECT: end
diff --git a/zeffir/test/test_ctype.py b/zeffir/test/test_ctype.py
--- a/zeffir/test/test_ctype.py
+++ b/zeffir/test/test_ctype.py
@@ -73,3 +73,15 @@
         assert repr(ffi.typeof("foo_t")) == "<ctype 'long'>"
     else:
         assert repr(ffi.typeof("foo_t")) == "<ctype 'long long'>"
+    #
+    assert ffi.sizeof("rfoo_t") == ffi.sizeof("char")
+    assert repr(ffi.typeof("rfoo_t")) == "<ctype 'signed char'>"
+    #
+    assert ffi.sizeof("bar_t") == ffi.sizeof("long double")
+    if ffi.sizeof("long double") == ffi.sizeof("double"):
+        assert repr(ffi.typeof("bar_t")) == "<ctype 'double'>"
+    else:
+        assert repr(ffi.typeof("bar_t")) == "<ctype 'long double'>"
+    #
+    assert ffi.sizeof("rbar_t") == ffi.sizeof("float")
+    assert repr(ffi.typeof("rbar_t")) == "<ctype 'float'>"


More information about the pypy-commit mailing list