Mercurial > hg > xemacs-beta
comparison tests/automated/weak-tests.el @ 1773:aa0db78e67c4
[xemacs-hg @ 2003-11-01 14:54:53 by kaltenbach]
Bugfix in USE_KKCC mode processing weak data structures
2003-11-01 Markus Kaltenbach <makalten@informatik.uni-tuebingen.de>
* src/alloc.c (garbage_collect_1):fix bug
* automated/weak-tests.el:added test to track it down
author | kaltenbach |
---|---|
date | Sat, 01 Nov 2003 14:55:00 +0000 |
parents | 90502933fb98 |
children | cef5f57bb9e2 |
comparison
equal
deleted
inserted
replaced
1772:c6b9198bfc23 | 1773:aa0db78e67c4 |
---|---|
220 (Assert (equal (weak-list-list weaklist2) (list b (cons (cons 1 2) a) b))) | 220 (Assert (equal (weak-list-list weaklist2) (list b (cons (cons 1 2) a) b))) |
221 (Assert (equal (weak-list-list weaklist3) (list b (cons a (cons 1 2)) b))) | 221 (Assert (equal (weak-list-list weaklist3) (list b (cons a (cons 1 2)) b))) |
222 (Assert (equal (weak-list-list weaklist4) testlist))) | 222 (Assert (equal (weak-list-list weaklist4) testlist))) |
223 | 223 |
224 (garbage-collect) | 224 (garbage-collect) |
225 | |
226 ;; test the intended functionality of the fixpoint iteration used for marking | |
227 ;; weak data structures like the ephermerons. Basically this tests gc_internals | |
228 ;; to work properly but it also ensures the ephemerons behave according to the | |
229 ;; specification | |
230 | |
231 (let* ((inner_cons (cons 1 2)) | |
232 (weak1 (make-ephemeron inner_cons | |
233 (make-ephemeron inner_cons | |
234 (cons 1 2) | |
235 '(lambda (v) t)) | |
236 '(lambda (v) t)))) | |
237 (Assert (ephemeron-ref (ephemeron-ref weak1))) | |
238 (garbage-collect) | |
239 ;; assure the inner ephis are still there | |
240 (Assert (ephemeron-ref (ephemeron-ref weak1))) | |
241 ;; delete the key reference and force cleaning up the garbage | |
242 (setq inner_cons (cons 3 4)) | |
243 (garbage-collect) | |
244 (Assert (not (ephemeron-ref weak1))) | |
245 ) | |
246 | |
247 (garbage-collect) |