[pypy-commit] cffi default: Fix the tests
arigo
noreply at buildbot.pypy.org
Tue Aug 7 10:24:09 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r787:1241e226b041
Date: 2012-08-07 10:23 +0200
http://bitbucket.org/cffi/cffi/changeset/1241e226b041/
Log: Fix the tests
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1300,6 +1300,7 @@
BArray = new_array_type(new_pointer_type(BByte), None)
a = newp(BArray, [65, 66, 67])
assert type(string(a)) is str and string(a) == 'ABC'
+ assert string(a, 8).startswith('ABC') # may contain additional garbage
def test_string_wchar():
BWChar = new_primitive_type("wchar_t")
@@ -1309,7 +1310,7 @@
BArray = new_array_type(new_pointer_type(BWChar), None)
a = newp(BArray, [u'A', u'B', u'C'])
assert type(string(a)) is unicode and string(a) == u'ABC'
- assert string(a, 10) == u'ABC'
+ assert string(a, 8).startswith(u'ABC') # may contain additional garbage
def test_string_typeerror():
BShort = new_primitive_type("short")
More information about the pypy-commit
mailing list