Author: Armin Rigo <[email protected]>
Branch: marker
Changeset: r1195:677236438589
Date: 2014-05-04 16:30 +0200
http://bitbucket.org/pypy/stmgc/changeset/677236438589/
Log: Failing test
diff --git a/c7/test/test_marker.py b/c7/test/test_marker.py
--- a/c7/test/test_marker.py
+++ b/c7/test/test_marker.py
@@ -208,14 +208,16 @@
def test_double_abort_markers_cb_inevitable(self):
@ffi.callback("void(char *, uintptr_t, object_t *, char *, size_t)")
def expand_marker(base, number, ptr, outbuf, outbufsize):
- s = '%d\x00' % (number,)
+ s = '%d %r\x00' % (number, stm_get_char(p))
assert len(s) <= outbufsize
outbuf[0:len(s)] = s
lib.stmcb_expand_marker = expand_marker
#
self.start_transaction()
+ p = stm_allocate(16)
+ stm_set_char(p, 'A')
self.push_root(ffi.cast("object_t *", 19))
- self.push_root(ffi.cast("object_t *", ffi.NULL))
+ self.push_root(ffi.cast("object_t *", p))
self.become_inevitable()
self.pop_root()
self.pop_root()
@@ -225,14 +227,16 @@
#
self.switch(1)
self.start_transaction()
+ p = stm_allocate(16)
+ stm_set_char(p, 'B')
self.push_root(ffi.cast("object_t *", 21))
- self.push_root(ffi.cast("object_t *", ffi.NULL))
+ self.push_root(ffi.cast("object_t *", p))
py.test.raises(Conflict, self.become_inevitable)
#
tl = self.get_stm_thread_local()
assert tl.longest_marker_state == lib.STM_TIME_RUN_ABORTED_INEVITABLE
- assert ffi.string(tl.longest_marker_self) == '21'
- assert ffi.string(tl.longest_marker_other) == '19'
+ assert ffi.string(tl.longest_marker_self) == "21 'B'"
+ assert ffi.string(tl.longest_marker_other) == "19 'A'"
def test_read_write_contention(self):
@ffi.callback("void(char *, uintptr_t, object_t *, char *, size_t)")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit