mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Use a helper thread to make the test more reliable
* test/src/fns-tests.el (ft-weak-equal-table): With wide-ints, the test unexpecetly passed probably because some stray reference to '(key 0) was on the stack. With a helper thread, the test works as expected.
This commit is contained in:
parent
dc94610043
commit
a4dcb8ef73
1 changed files with 4 additions and 1 deletions
|
|
@ -1423,6 +1423,8 @@
|
|||
|
||||
(ert-deftest ft-weak-equal-table ()
|
||||
:expected-result (if (fboundp 'igc--collect) :failed :passed)
|
||||
(unless (featurep 'threads)
|
||||
(ert-skip '(not (featurep 'threads))))
|
||||
(let* ((h (make-hash-table :weakness 'key-or-value :test #'equal))
|
||||
(n 10)
|
||||
(root nil))
|
||||
|
|
@ -1432,7 +1434,8 @@
|
|||
(puthash key val h)))
|
||||
(should (= (hash-table-count h) n))
|
||||
(ft--gc 'key)
|
||||
(setq root (gethash '(key 0) h))
|
||||
(setq root (thread-join (make-thread (lambda ()
|
||||
(gethash '(key 0) h)))))
|
||||
(ft--gc 'key-or-value)
|
||||
(should (< (hash-table-count h) n))
|
||||
(should (equal root (gethash '(key 0) h)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue