From bd51d8c1a5bb30e6a358dee6e85963f777edfff4 Mon Sep 17 00:00:00 2001 From: moteus Date: Mon, 27 May 2013 11:26:35 +0400 Subject: [PATCH] Fix. Optional IPv6 test --- test/testclnt.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/testclnt.lua b/test/testclnt.lua index 8acb3d0..315783b 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua @@ -642,7 +642,10 @@ local tcp_methods = { "shutdown", } test_methods(socket.tcp(), tcp_methods) -test_methods(socket.tcp6(), tcp_methods) +do local sock = socket.tcp6() +if sock then test_methods(socket.tcp6(), tcp_methods) +else io.stderr:write("Warning! IPv6 does not support!\n") end +end local udp_methods = { "close", @@ -666,7 +669,10 @@ local udp_methods = { ------------------------------------------------------------------------ test_methods(socket.udp(), udp_methods) -test_methods(socket.udp6(), udp_methods) +do local sock = socket.tcp6() +if sock then test_methods(socket.udp6(), udp_methods) +else io.stderr:write("Warning! IPv6 does not support!\n") end +end test("partial receive") test_partialrecv()