[pypy-commit] cffi cffi-1.0: fix test

arigo noreply at buildbot.pypy.org
Sun May 3 19:18:55 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1908:4fa6a0139035
Date: 2015-05-03 19:19 +0200
http://bitbucket.org/cffi/cffi/changeset/4fa6a0139035/

Log:	fix test

diff --git a/_cffi1/test_verify1.py b/_cffi1/test_verify1.py
--- a/_cffi1/test_verify1.py
+++ b/_cffi1/test_verify1.py
@@ -622,8 +622,11 @@
     ffi.cdef(code)
     ffi.verify(code)
     s = ffi.new("foo_s *")
-    s.f = 2
-    assert s.f == 2
+    s.f = 1
+    assert s.f == 1
+    two = int(ffi.cast("foo_e", 2))     # may be 2 or -2 based on the sign
+    s.f = two
+    assert s.f == two
 
 def test_unsupported_struct_with_bitfield_ellipsis():
     ffi = FFI()


More information about the pypy-commit mailing list