From a34d5fc9fb803e7cd3b123445f615018c2e1e23c Mon Sep 17 00:00:00 2001 From: max Date: Tue, 1 Apr 2014 12:17:36 +0000 Subject: Add test cases for Bug [97069ea11a]. --- tests/socket.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/socket.test b/tests/socket.test index 0ae5abd..5a6d9cd 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -1672,6 +1672,33 @@ test socket-13.1 {Testing use of shared socket between two threads} \ } -cleanup { removeFile script } -result {hello 1} +test socket-14.11.0 {pending [socket -async] and blocking [puts], no listener, no flush} \ + -constraints {socket} \ + -body { + set sock [socket -async 169.254.0.0 42424] + fconfigure $sock -blocking 0 + puts $sock ok + fileevent $sock writable {set x 1} + vwait x + close $sock + } -cleanup { + catch {close $sock} + unset x + } -result {host is unreachable} -returnCodes 1 +test socket-14.11.1 {pending [socket -async] and blocking [puts], no listener, flush} \ + -constraints {socket} \ + -body { + set sock [socket -async 169.254.0.0 42424] + fconfigure $sock -blocking 0 + puts $sock ok + flush $sock + fileevent $sock writable {set x 1} + vwait x + close $sock + } -cleanup { + catch {close $sock} + catch {unset x} + } -result {host is unreachable} -returnCodes 1 removeFile script1 removeFile script2 -- cgit v0.12