[pypy-commit] pypy stm-gc: Improve error reporting.

arigo noreply at buildbot.pypy.org
Thu Feb 9 21:42:37 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r52333:77cae4242592
Date: 2012-02-09 18:21 +0100
http://bitbucket.org/pypy/pypy/changeset/77cae4242592/

Log:	Improve error reporting.

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
@@ -34,6 +34,7 @@
 def check_chained_list(node):
     seen = [0] * (glob.LENGTH+1)
     seen[-1] = glob.NUM_THREADS
+    errors = glob.LENGTH
     while node is not None:
         value = node.value
         #print value
@@ -42,10 +43,14 @@
             raise AssertionError
         seen[value] += 1
         if seen[value] > seen[value-1]:
-            print "seen[%d] = %d, seen[%d] = %d" % (value-1, seen[value-1],
-                                                    value, seen[value])
-            raise AssertionError
+            errors = min(errors, value)
         node = node.next
+    if errors < glob.LENGTH:
+        value = errors
+        print "seen[%d] = %d, seen[%d] = %d" % (value-1, seen[value-1],
+                                                value, seen[value])
+        raise AssertionError
+
     if seen[glob.LENGTH-1] != glob.NUM_THREADS:
         print "seen[LENGTH-1] != NUM_THREADS"
         raise AssertionError


More information about the pypy-commit mailing list