[pypy-commit] cffi default: fix the test, which was randomly occasionally failing
arigo
noreply at buildbot.pypy.org
Sun Nov 4 11:26:39 CET 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r1029:30115faf8019
Date: 2012-11-04 11:26 +0100
http://bitbucket.org/cffi/cffi/changeset/30115faf8019/
Log: fix the test, which was randomly occasionally failing
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1444,7 +1444,11 @@
a = newp(BArray, [u+'A', u+'B', u+'C'])
assert type(string(a)) is unicode and string(a) == u+'ABC'
if 'PY_DOT_PY' not in globals() and sys.version_info < (3,):
- assert string(a, 8).startswith(u+'ABC') # may contain additional garbage
+ try:
+ # may contain additional garbage
+ assert string(a, 8).startswith(u+'ABC')
+ except ValueError: # garbage contains values > 0x10FFFF
+ assert sizeof(BWChar) == 4
def test_string_typeerror():
BShort = new_primitive_type("short")
More information about the pypy-commit
mailing list