Commit b425e275952 by Armin Rigo

future test about stealing

--HG--
branch : bag
parent d94ccb7c158
......@@ -181,3 +181,24 @@ class TestBag(BaseTestBag):
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'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment