[pypy-commit] cffi default: Actually, we can test directly that getptr() returns the address of the

arigo noreply at buildbot.pypy.org
Sun May 31 18:23:55 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2147:729a228d5883
Date: 2015-05-31 18:24 +0200
http://bitbucket.org/cffi/cffi/changeset/729a228d5883/

Log:	Actually, we can test directly that getptr() returns the address of
	the variable.

diff --git a/testing/cffi1/test_verify1.py b/testing/cffi1/test_verify1.py
--- a/testing/cffi1/test_verify1.py
+++ b/testing/cffi1/test_verify1.py
@@ -2129,10 +2129,7 @@
         static int *getptr(void) { return &foo_verify_dlopen_flags; }
     """)
     p = lib2.getptr()
-    lib1.foo_verify_dlopen_flags = 42
-    assert p[0] == 42
-    p[0] += 1
-    assert lib1.foo_verify_dlopen_flags == 43
+    assert ffi1.addressof(lib1, 'foo_verify_dlopen_flags') == p
 
 def test_consider_not_implemented_function_type():
     ffi = FFI()


More information about the pypy-commit mailing list