[pypy-commit] cffi default: An extra test to distinguish wchar_t from char32_t, at least on linux

arigo pypy.commits at gmail.com
Fri Jun 2 04:11:26 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2966:46cd2faf0897
Date: 2017-06-02 10:11 +0200
http://bitbucket.org/cffi/cffi/changeset/46cd2faf0897/

Log:	An extra test to distinguish wchar_t from char32_t, at least on
	linux

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -2099,6 +2099,10 @@
 
 def test_wchar():
     _test_wchar_variant("wchar_t")
+    if sys.platform.startswith("linux"):
+        BWChar = new_primitive_type("wchar_t")
+        assert sizeof(BWChar) == 4
+        assert int(cast(BWChar, -1)) == -1        # signed, on linux
 
 def test_char16():
     BChar16 = new_primitive_type("char16_t")


More information about the pypy-commit mailing list