summaryrefslogtreecommitdiffstats
path: root/tests/014
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-24 19:41:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-03-24 19:41:21 -0700
commit6364a9c13ef954f0a3e29dae1fff3e9d8bd0a10e (patch)
treed783f0e88977ac117fb9314748132b559133eb52 /tests/014
parentf880b206a479bf4cd8ccac26f33a9cc3d490d6b7 (diff)
downloadtxr-6364a9c13ef954f0a3e29dae1fff3e9d8bd0a10e.tar.gz
txr-6364a9c13ef954f0a3e29dae1fff3e9d8bd0a10e.tar.bz2
txr-6364a9c13ef954f0a3e29dae1fff3e9d8bd0a10e.zip
MacOS: adjust socket-basic test for dgram size.
* tests/014/socket-basic.tl (%iters%): New variable. 2000 on MacOS, 5000 elsewhere. (client, server): Use %iters% instead of hard-coded 5000. (test): Rename to sock-test, since it clashes with the test macro coming from common.tl, which we neeed to for the os-symbol function.
Diffstat (limited to 'tests/014')
-rw-r--r--tests/014/socket-basic.tl11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/014/socket-basic.tl b/tests/014/socket-basic.tl
index efeed2d6..bbdab7f9 100644
--- a/tests/014/socket-basic.tl
+++ b/tests/014/socket-basic.tl
@@ -1,21 +1,24 @@
(load "../sock-common.tl")
+(load "../common.tl")
(defvar socktype)
+(defvar %iters% (if (eql :macos (os-symbol)) 2000 5000))
+
(defun client (addr)
(with-stream (cli-sock (open-socket af-inet socktype))
(sock-connect cli-sock addr)
(put-string "5000" cli-sock)
(sock-shutdown cli-sock)
- (equal (read cli-sock) (range 1 5000))))
+ (equal (read cli-sock) (range 1 %iters%))))
(defun server (svc-sock)
(let* ((acc-sock (sock-accept svc-sock))
(query (read acc-sock)))
- (print (range 1 5000) acc-sock)
+ (print (range 1 %iters%) acc-sock)
(close-stream acc-sock)))
-(defun test ()
+(defun sock-test ()
(let* ((svc-sock (open-socket af-inet socktype))
(svc-addr (bindfree svc-sock 1025 65535))
(child-pid (fork)))
@@ -27,5 +30,5 @@
(if (and (fboundp 'open-socket)
(fboundp 'fork))
(each ((socktype (list sock-dgram sock-stream)))
- (unless (test)
+ (unless (sock-test)
(error "test failed"))))