Fix. test_socket_error

This commit is contained in:
moteus 2013-06-11 15:36:53 +04:00
parent f27d63f7b6
commit 8d933916d8

View File

@ -14,8 +14,12 @@ assert('timeout' == err)
for i = 1, 10 do for i = 1, 10 do
-- select pass even if socket has error -- select pass even if socket has error
local _, rec, err = socket.select(nil, {sock}, 1) local _, rec, err = socket.select(nil, {sock}, 1)
assert('timeout' == err) local _, ss = next(rec)
assert(not next(rec)) if ss then
assert(ss == sock)
else
assert('timeout' == err, 'unexpected error :' .. tostring(err))
end
err = sock:getoption("error") -- i get 'connection refused' on WinXP err = sock:getoption("error") -- i get 'connection refused' on WinXP
if err then if err then
print("Passed! Error is '" .. err .. "'.") print("Passed! Error is '" .. err .. "'.")