From 3ea159afc5c476e06148cf5fc2a1fb77267326f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 15 Feb 2010 18:43:20 +0100 Subject: [PATCH] Add `getaddrinfo' test. * test-suite/tests/net-db.test ("getaddrinfo")["port 80 with family and socket type"]: New test. --- test-suite/tests/net-db.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test-suite/tests/net-db.test b/test-suite/tests/net-db.test index 7364d82ad..403305372 100644 --- a/test-suite/tests/net-db.test +++ b/test-suite/tests/net-db.test @@ -54,6 +54,17 @@ #t ai)))) + (pass-if "port 80 with family and socket type" + (let ((ai (getaddrinfo #f "80" (logior AI_ADDRCONFIG AI_NUMERICSERV) + AF_UNSPEC SOCK_STREAM))) + (and (> (length ai) 0) + (fold (lambda (ai ok?) + (let ((sa (addrinfo:addr ai))) + (and ok? + (= (sockaddr:port sa) 80)))) + #t + ai)))) + (pass-if "no name" (catch 'getaddrinfo-error (lambda ()