[pypy-commit] stmgc hashtable-iter: test stm_hashtable_list(..., NULL)
arigo
noreply at buildbot.pypy.org
Sun Feb 1 10:52:10 CET 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: hashtable-iter
Changeset: r1602:de27e8f11e38
Date: 2015-02-01 10:52 +0100
http://bitbucket.org/pypy/stmgc/changeset/de27e8f11e38/
Log: test stm_hashtable_list(..., NULL)
diff --git a/c7/test/test_hashtable.py b/c7/test/test_hashtable.py
--- a/c7/test/test_hashtable.py
+++ b/c7/test/test_hashtable.py
@@ -29,6 +29,11 @@
return [(lib._get_entry_index(entries[i]),
lib._get_entry_object(entries[i])) for i in range(count)]
+def htlen(o):
+ h = get_hashtable(o)
+ count = lib.stm_hashtable_list(o, h, ffi.NULL)
+ return count
+
class BaseTestHashtable(BaseTest):
@@ -271,6 +276,14 @@
assert len(lst) == 29
assert sorted(lst) == sorted(expected)
+ def test_list_3(self):
+ self.start_transaction()
+ h = self.allocate_hashtable()
+ tl0 = self.tls[self.current_thread]
+ for i in range(29):
+ htset(h, 19 ^ i, stm_allocate(32), tl0)
+ assert htlen(h) == 29
+
class TestRandomHashtable(BaseTestHashtable):
More information about the pypy-commit
mailing list