From 46736a33555c51bd5bbba872087b518525dcf1cc Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sun, 29 Apr 2012 20:44:15 +0200 Subject: [PATCH 1/3] Test method registration for IPv6 sockets --- test/testclnt.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/testclnt.lua b/test/testclnt.lua index b4b7063..ee716f9 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua @@ -617,7 +617,8 @@ end ------------------------------------------------------------------------ test("method registration") -test_methods(socket.tcp(), { + +local tcp_methods = { "accept", "bind", "close", @@ -637,9 +638,11 @@ test_methods(socket.tcp(), { "setsockname", "settimeout", "shutdown", -}) +} +test_methods(socket.tcp(), tcp_methods) +test_methods(socket.tcp6(), tcp_methods) -test_methods(socket.udp(), { +local udp_methods = { "close", "getpeername", "dirty", @@ -655,7 +658,9 @@ test_methods(socket.udp(), { "setpeername", "setsockname", "settimeout" -}) +} +test_methods(socket.udp(), udp_methods) +test_methods(socket.udp6(), udp_methods) test("partial receive") test_partialrecv() From cf4d29f86d722d7398b59c41c190d545e8c7a8c2 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sun, 29 Apr 2012 20:46:35 +0200 Subject: [PATCH 2/3] Select loadstring or load for Lua 5.1/5.2 respectively --- test/testsrvr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsrvr.lua b/test/testsrvr.lua index ff31442..72b93ab 100644 --- a/test/testsrvr.lua +++ b/test/testsrvr.lua @@ -15,6 +15,6 @@ while 1 do assert(command, emsg) assert(control:send(ack)); print(command); - (load(command))(); + ((loadstring or load)(command))(); end end From 6de0aa54fd1e296f685acc453bf08a2c2c4bd71f Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sun, 29 Apr 2012 21:03:28 +0200 Subject: [PATCH 3/3] Update method list in tests --- test/testclnt.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testclnt.lua b/test/testclnt.lua index ee716f9..a510ded 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua @@ -624,7 +624,9 @@ local tcp_methods = { "close", "connect", "dirty", + "getfamily", "getfd", + "getoption", "getpeername", "getsockname", "getstats", @@ -644,9 +646,10 @@ test_methods(socket.tcp6(), tcp_methods) local udp_methods = { "close", - "getpeername", "dirty", + "getfamily", "getfd", + "getoption", "getpeername", "getsockname", "receive",