[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 13/13: socket test should not throw unresolved outside o
From: |
Mike Gran |
Subject: |
[Guile-commits] 13/13: socket test should not throw unresolved outside of a test |
Date: |
Thu, 21 Jan 2021 19:06:19 -0500 (EST) |
mike121 pushed a commit to branch master
in repository guile.
commit 91d4d311846b640efdd5705eb0c36217e373c01a
Author: Michael Gran <spk121@yahoo.com>
AuthorDate: Wed Dec 30 06:00:35 2020 -0800
socket test should not throw unresolved outside of a test
* test-suite/tests/00-socket.test: don't throw unresolved outside of a
test
---
test-suite/tests/00-socket.test | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/test-suite/tests/00-socket.test b/test-suite/tests/00-socket.test
index 3657628..9d45109 100644
--- a/test-suite/tests/00-socket.test
+++ b/test-suite/tests/00-socket.test
@@ -264,24 +264,25 @@
(force-output (current-output-port))
(force-output (current-error-port))
- (if server-listening?
- (let ((pid (primitive-fork-if-available)))
- ;; Spawn a server process.
- (case pid
- ((-1) (throw 'unresolved))
- ((0) ;; the kid: serve two connections and exit
- (let serve ((conn
- (false-if-exception (accept server-socket)))
- (count 1))
- (if (not conn)
- (exit 1)
- (if (> count 0)
- (serve (false-if-exception (accept server-socket))
- (- count 1)))))
- (exit 0))
- (else ;; the parent
- (set! server-pid pid)
- #t))))
+ (when server-listening?
+ (let ((pid (primitive-fork-if-available)))
+ ;; Spawn a server process.
+ (case pid
+ ((-1) ;; fork not available
+ #f)
+ ((0) ;; the kid: serve two connections and exit
+ (let serve ((conn
+ (false-if-exception (accept server-socket)))
+ (count 1))
+ (if (not conn)
+ (exit 1)
+ (if (> count 0)
+ (serve (false-if-exception (accept server-socket))
+ (- count 1)))))
+ (exit 0))
+ (else ;; the parent
+ (set! server-pid pid)
+ #t))))
(pass-if "connect"
(if (not server-pid)
- [Guile-commits] 04/13: in command line encoding test don't presume extant UTF-8 locale, (continued)
- [Guile-commits] 04/13: in command line encoding test don't presume extant UTF-8 locale, Mike Gran, 2021/01/21
- [Guile-commits] 03/13: skip compile test when pause not available, Mike Gran, 2021/01/21
- [Guile-commits] 06/13: test-foreign-object-c should link libgnu, Mike Gran, 2021/01/21
- [Guile-commits] 05/13: for dynamic-link tests, mingw needs to link to msvcrt, Mike Gran, 2021/01/21
- [Guile-commits] 07/13: missing includes for list.h, Mike Gran, 2021/01/21
- [Guile-commits] 08/13: Need Guile and Windows types for the declarations posix-w32, Mike Gran, 2021/01/21
- [Guile-commits] 09/13: in null threads, don't define sigmask stub when pthread_sigmask does not exist, Mike Gran, 2021/01/21
- [Guile-commits] 11/13: standalone tests require libgnu on DLL-based platforms, Mike Gran, 2021/01/21
- [Guile-commits] 12/13: avoid a ports test when fcntl is not provided, Mike Gran, 2021/01/21
- [Guile-commits] 10/13: skip version test if git-version-gen can't compute version from git, Mike Gran, 2021/01/21
- [Guile-commits] 13/13: socket test should not throw unresolved outside of a test,
Mike Gran <=