diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-02 11:25:35 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-10-02 11:25:35 (GMT) |
commit | 749261e241849834a5cfc70808260a534e50875f (patch) | |
tree | afbaa8979a5b74dd2f3236454b661fdcf2b9d4c8 /Lib/ctypes | |
parent | 5593d8aeb4bcc904ff58e8e3eb8b799a0aabc302 (diff) | |
download | cpython-749261e241849834a5cfc70808260a534e50875f.zip cpython-749261e241849834a5cfc70808260a534e50875f.tar.gz cpython-749261e241849834a5cfc70808260a534e50875f.tar.bz2 |
Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t
Diffstat (limited to 'Lib/ctypes')
-rw-r--r-- | Lib/ctypes/test/test_strings.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_strings.py b/Lib/ctypes/test/test_strings.py index d6ffe3f..1a9bdbc 100644 --- a/Lib/ctypes/test/test_strings.py +++ b/Lib/ctypes/test/test_strings.py @@ -74,6 +74,13 @@ else: buf[1] = "Z" self.assertEqual(buf.value, "xZCD") + @unittest.skipIf(sizeof(c_wchar) < 4, + "sizeof(wchar_t) is smaller than 4 bytes") + def test_nonbmp(self): + u = chr(0x10ffff) + w = c_wchar(u) + self.assertEqual(w.value, u) + class StringTestCase(unittest.TestCase): def XX_test_basic_strings(self): cs = c_string("abcdef") |