Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r257:b9d9edc34feb
Date: 2013-06-24 14:58 +0200
http://bitbucket.org/pypy/stmgc/changeset/b9d9edc34feb/

Log:    Two extras passing tests

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
@@ -383,3 +383,33 @@
     p1 = lib.stm_pop_root()
     check_not_free(p1)
     check_not_free(lib.getptr(p1, 0))
+
+def test_prebuilt_modified_during_transaction():
+    p1 = palloc(HDR)
+    p2 = nalloc_refs(1)
+    lib.setptr(p2, 0, p1)
+    lib.stm_push_root(p2)
+    major_collect()
+    major_collect()
+    p1b = lib.stm_write_barrier(p1)
+    assert p1b != p1
+    major_collect()
+    lib.stm_pop_root()
+    p1b = lib.stm_read_barrier(p1)
+    check_not_free(p1b)
+
+def test_prebuilt_modified_later():
+    p1 = palloc(HDR)
+    p2 = nalloc_refs(1)
+    lib.setptr(p2, 0, p1)
+    lib.stm_push_root(p2)
+    major_collect()
+    major_collect()
+    p1b = lib.stm_write_barrier(p1)
+    assert p1b != p1
+    lib.stm_commit_transaction()
+    lib.stm_begin_inevitable_transaction()
+    major_collect()
+    lib.stm_pop_root()
+    p1b = lib.stm_read_barrier(p1)
+    check_not_free(p1b)
diff --git a/c4/test/test_random.py b/c4/test/test_random.py
--- a/c4/test/test_random.py
+++ b/c4/test/test_random.py
@@ -522,4 +522,4 @@
 def test_more_multi_thread():
     #py.test.skip("more random tests")
     for i in range(200):
-        yield test_multi_thread, 1690 + i
+        yield test_multi_thread, 1751 + i
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to