Author: Armin Rigo <[email protected]>
Branch:
Changeset: r80707:eed1d339f370
Date: 2015-11-16 12:07 +0100
http://bitbucket.org/pypy/pypy/changeset/eed1d339f370/
Log: Forgot an added file
diff --git a/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_commontypes.py
b/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_commontypes.py
new file mode 100644
--- /dev/null
+++ b/pypy/module/test_lib_pypy/cffi_tests/cffi1/test_commontypes.py
@@ -0,0 +1,35 @@
+# Generated by pypy/tool/import_cffi.py
+import py, os, cffi, re
+import _cffi_backend
+
+
+def getlines():
+ try:
+ f = open(os.path.join(os.path.dirname(cffi.__file__),
+ '..', 'c', 'commontypes.c'))
+ except IOError:
+ py.test.skip("cannot find ../c/commontypes.c")
+ lines = [line for line in f.readlines() if line.strip().startswith('EQ(')]
+ f.close()
+ return lines
+
+def test_alphabetical_order():
+ lines = getlines()
+ assert lines == sorted(lines)
+
+def test_dependencies():
+ r = re.compile(r'EQ[(]"([^"]+)",(?:\s*"([A-Z0-9_]+)\s*[*]*"[)])?')
+ lines = getlines()
+ d = {}
+ for line in lines:
+ match = r.search(line)
+ if match is not None:
+ d[match.group(1)] = match.group(2)
+ for value in d.values():
+ if value:
+ assert value in d
+
+def test_get_common_types():
+ d = {}
+ _cffi_backend._get_common_types(d)
+ assert d["bool"] == "_Bool"
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit