Author: Armin Rigo <ar...@tunes.org>
Branch: copy-over-original2
Changeset: r438:f6b4d8cafc3e
Date: 2013-07-25 17:35 +0200
http://bitbucket.org/pypy/stmgc/changeset/f6b4d8cafc3e/

Log:    More fixes in the tests

diff --git a/c4/test/support.py b/c4/test/support.py
--- a/c4/test/support.py
+++ b/c4/test/support.py
@@ -589,6 +589,12 @@
     p1.h_tid |= GCFLAG_PUBLIC_TO_PRIVATE
     if p1.h_tid & GCFLAG_PREBUILT_ORIGINAL:
         lib.stm_add_prebuilt_root(p1)
+    assert p2.h_original == 0
+    assert p1 != p2
+    if (p1.h_original == 0) or (p1.h_tid & GCFLAG_PREBUILT_ORIGINAL):
+        p2.h_original = ffi.cast("revision_t", p1)
+    else:
+        p2.h_original = p1.h_original
 
 def delegate_original(p1, p2):
     # no h_original or it is a prebuilt with a specified hash in h_original
diff --git a/c4/test/test_gcpage.py b/c4/test/test_gcpage.py
--- a/c4/test/test_gcpage.py
+++ b/c4/test/test_gcpage.py
@@ -204,7 +204,6 @@
     p1 = oalloc(HDR); make_public(p1)
     p2 = oalloc(HDR); make_public(p2)
     delegate(p1, p2)
-    delegate_original(p1, p2)
     lib.stm_push_root(p1)
     major_collect()
     major_collect()
@@ -226,14 +225,14 @@
     major_collect()
     major_collect()
     p2b = lib.stm_pop_root()
-    assert p2b == p4
-    check_free_old(p1)
+    assert p2b == p1
+    check_not_free(p1)
     check_free_old(p2)
     check_free_old(p3)
-    check_not_free(p4)
-    p5 = lib.stm_write_barrier(p4)
-    assert p5 != p4
-    assert p5 == lib.stm_write_barrier(p4)
+    check_free_old(p4)
+    p5 = lib.stm_write_barrier(p1)
+    assert p5 != p1
+    assert p5 == lib.stm_write_barrier(p1)
     assert p5 == lib.stm_write_barrier(p5)
 
 def test_new_version_kill_intermediate_non_root():
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to