1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +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"
(let* ((port (open-file "/dev/null" "r0"))
(fdes (port->fdes port)) ;increments revealed count of PORT
(guardian (make-guardian)))
(guardian port)
(fdes (port->fdes port)))
(set! port #f)
(gc)
(if (port? (guardian))
(and (zero? (seek fdes 0 SEEK_CUR))
(begin
(close-fdes fdes)
#t))
(begin
(close-fdes fdes)
(throw 'unresolved)))))
;; Note: We can't know for sure whether PORT was GC'd; using a
;; guardian is not an option because it would keep it alive.
(and (zero? (seek fdes 0 SEEK_CUR))
(begin
(close-fdes fdes)
#t))))
(when (provided? 'threads)
(let* ((p (pipe))