Author: Armin Rigo <[email protected]>
Branch: bag
Changeset: r1586:b425e275952a
Date: 2015-01-24 16:17 +0100
http://bitbucket.org/pypy/stmgc/changeset/b425e275952a/
Log: future test about stealing
diff --git a/c7/test/test_bag.py b/c7/test/test_bag.py
--- a/c7/test/test_bag.py
+++ b/c7/test/test_bag.py
@@ -181,3 +181,24 @@
assert stm_get_char(lp2) == 'N'
#
stm_major_collect() # to get rid of the bag object
+
+ def test_stealing(self):
+ py.test.skip("in-progress")
+ self.start_transaction()
+ q = self.allocate_bag()
+ self.push_root(q)
+ lp1 = stm_allocate(16)
+ lp2 = stm_allocate(16)
+ stm_set_char(lp1, 'M')
+ stm_set_char(lp2, 'N')
+ b_add(q, lp1)
+ b_add(q, lp2)
+ self.commit_transaction()
+ q = self.pop_root()
+ #
+ self.switch(1)
+ self.start_transaction()
+ lp1 = b_pop(q)
+ lp2 = b_pop(q)
+ assert stm_get_char(lp1) == 'M'
+ assert stm_get_char(lp2) == 'N'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit