1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 16:00:22 +02:00

tests: Don't use a guardian when testing for GC'd ports.

This is a followup to 1008ea3154.

* test-suite/tests/ports.test ("non-revealed port is closed"): Don't use
a guardian.
This commit is contained in:
Ludovic Courtès 2020-05-12 14:44:53 +02:00
parent 3385f6e08c
commit 2ba61b8aea

View file

@ -616,19 +616,16 @@
(pass-if "revealed port fdes not closed" (pass-if "revealed port fdes not closed"
(let* ((port (open-file "/dev/null" "r0")) (let* ((port (open-file "/dev/null" "r0"))
(fdes (port->fdes port)) ;increments revealed count of PORT (fdes (port->fdes port)))
(guardian (make-guardian)))
(guardian port)
(set! port #f) (set! port #f)
(gc) (gc)
(if (port? (guardian))
(and (zero? (seek fdes 0 SEEK_CUR)) ;; Note: We can't know for sure whether PORT was GC'd; using a
(begin ;; guardian is not an option because it would keep it alive.
(close-fdes fdes) (and (zero? (seek fdes 0 SEEK_CUR))
#t)) (begin
(begin (close-fdes fdes)
(close-fdes fdes) #t))))
(throw 'unresolved)))))
(when (provided? 'threads) (when (provided? 'threads)
(let* ((p (pipe)) (let* ((p (pipe))