[pypy-commit] pypy stm-gc: Add a failing test

arigo noreply at buildbot.pypy.org
Thu Feb 23 13:58:03 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r52798:64b23c237c68
Date: 2012-02-23 13:18 +0100
http://bitbucket.org/pypy/pypy/changeset/64b23c237c68/

Log:	Add a failing test

diff --git a/pypy/translator/stm/test/targetdemo.py b/pypy/translator/stm/test/targetdemo.py
--- a/pypy/translator/stm/test/targetdemo.py
+++ b/pypy/translator/stm/test/targetdemo.py
@@ -63,6 +63,16 @@
     print "thread done."
     glob.done += 1
 
+def _check_pointer(arg1):
+    arg1.foobar = 40    # now 'arg1' is local
+    return arg1
+
+def check_pointer_equality(arg, retry_counter):
+    res = _check_pointer(arg)
+    if res is not arg:
+        debug_print("ERROR: bogus pointer equality")
+        raise AssertionError
+
 def run_me():
     rstm.descriptor_init()
     try:
@@ -70,6 +80,7 @@
         arg = glob._arg
         ll_thread.release_NOAUTO(glob.lock)
         arg.foobar = 41
+        rstm.perform_transaction(check_pointer_equality, Arg, arg)
         i = 0
         while i < glob.LENGTH:
             arg.anchor = glob.anchor


More information about the pypy-commit mailing list