some gc-related tests

svn: r12705
This commit is contained in:
Matthew Flatt 2008-12-04 23:04:10 +00:00
parent c47cbb564a
commit e1126a66ed
2 changed files with 17 additions and 0 deletions

View File

@ -1275,4 +1275,13 @@
; --------------------
;; Make sure shared thread cell is not exposed:
(test #f 'no-breaks (with-handlers ([void (lambda (x) (break-enabled))]) (/ 0)))
(test #t 'no-breaks (with-handlers ([void (lambda (x) (break-enabled #t) (break-enabled))]) (/ 0)))
(test #f 'no-breaks (with-handlers ([void (lambda (x) (break-enabled))]) (/ 0)))
(test #t 'no-breaks (with-handlers ([(lambda (x) (break-enabled #t)) (lambda (x) (break-enabled))]) (/ 0)))
(test #f 'no-breaks (with-handlers ([void (lambda (x) (break-enabled))]) (/ 0)))
; --------------------
(report-errs)

View File

@ -125,6 +125,14 @@
(custodian-shutdown-all c1)
(test '(#f #f) map custodian-box-value (list b1 b2)))
(let ()
(let ([c (make-custodian)])
(let ([l (for/list ([i (in-range 32)])
(make-custodian-box c 7))])
(test #t andmap (lambda (b) (number? (custodian-box-value b))) l)
(custodian-shutdown-all c)
(test #f ormap (lambda (b) (number? (custodian-box-value b))) l))))
;; ----------------------------------------
(report-errs)