From e4e2223cff658a7016724a625ebbd3dacb92a8f9 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Fri, 16 Jul 2004 06:48:48 +0000 Subject: Fixed a bunch of stuff. Added mike's patches. --- test/testclnt.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/testclnt.lua b/test/testclnt.lua index a1fd805..f98a504 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua @@ -283,7 +283,9 @@ function empty_connect() if not data then pass("ok") data = socket.connect(host, port) - else fail("should not have connected!") end + else + pass("gethostbyname returns localhost on empty string...") + end end ------------------------------------------------------------------------ @@ -374,19 +376,17 @@ end ------------------------------------------------------------------------ function connect_timeout() - io.stderr:write("connect with timeout (if it hangs, it failed): ") + io.stderr:write("connect with timeout (if it hangs, it failed!): ") local t = socket.gettime() local c, e = socket.tcp() assert(c, e) c:settimeout(0.1) - ip = socket.dns.toip("ibere.tecgraf.puc-rio.br") - if not ip then return end local t = socket.gettime() - local r, e = c:connect(ip, 80) + local r, e = c:connect("127.0.0.2", 80) assert(not r, "should not connect") - --assert(e == "timeout", e) assert(socket.gettime() - t < 2, "took too long to give up.") c:close() + print("ok") end ------------------------------------------------------------------------ -- cgit v1.2.3-55-g6feb