picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 3be020d71cee4479f55fb6e526b5480b0976f32f
parent 57f8b9774258e0dfbca0f67a6fee85a07c523192
Author: Alexander Burger <abu@software-lab.de>
Date:   Fri, 10 Jun 2011 14:18:32 +0200

Made all ports in the unit tests dynamic to avoid conflicts
Diffstat:
Mtest/lib.l | 6+++---
Mtest/src/main.l | 6+++---
Mtest/src/net.l | 26++++++++++++++------------
3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/test/lib.l b/test/lib.l @@ -1,12 +1,12 @@ -# 18mar10abu +# 10jun11abu # (c) Software Lab. Alexander Burger ### task ### (test (3 . 4) (let (*Run NIL *A NIL *B NIL) (task -10 0 (setq *A 3)) - (task (port T 4444) (eval (udp @))) - (udp "localhost" 4444 '(setq *B 4)) + (task (port T 0 "TaskPort") (eval (udp @))) + (udp "localhost" "TaskPort" '(setq *B 4)) (wait NIL (and *A *B)) (cons *A *B) ) ) diff --git a/test/src/main.l b/test/src/main.l @@ -1,4 +1,4 @@ -# 22feb11abu +# 10jun11abu # (c) Software Lab. Alexander Burger ### alarm ### @@ -13,10 +13,10 @@ ### sigio ### (unless (= *OS "SunOS") (off "SigVal") - (sigio (setq "SigSock" (port T 4444)) + (sigio (setq "SigSock" (port T 0 "SigPort")) (setq "SigVal" (udp "SigSock")) ) (test '((setq "SigVal" (udp "SigSock"))) (sigio)) - (udp "localhost" 4444 '(a b c)) + (udp "localhost" "SigPort" '(a b c)) (wait 200) (test '(a b c) "SigVal") (sigio "SigSock") diff --git a/test/src/net.l b/test/src/net.l @@ -1,25 +1,27 @@ -# 24nov09abu +# 10jun11abu # (c) Software Lab. Alexander Burger ### port listen connect ### (test '(a b c) - (if (fork) - (let P (port 4445) + (let P (port 0 "ListenPort") + (if (fork) (prog1 (in (listen P) (rd)) - (close P) ) ) - (wait 400) - (and (connect "localhost" 4445) (out @ (pr '(a b c)))) - (bye) ) ) + (close P) ) + (close P) + (wait 400) + (and (connect "localhost" "ListenPort") (out @ (pr '(a b c)))) + (bye) ) ) ) ### udp ### (test '(a b c) - (ifn (fork) - (prog + (let P (port T 0 "UdpPort") + (if (fork) + (udp P) + (close P) (wait 400) - (udp "localhost" 4446 '(a b c)) - (bye) ) - (udp (port T 4446)) ) ) + (udp "localhost" "UdpPort" '(a b c)) + (bye) ) ) ) # vi:et:ts=3:sw=3