summaryrefslogtreecommitdiffstats
path: root/tests/socket.test
diff options
context:
space:
mode:
authormax <max@tclers.tk>2014-04-04 11:53:33 (GMT)
committermax <max@tclers.tk>2014-04-04 11:53:33 (GMT)
commita07a756335137e754bcd490da46a1cc1fd8df06c (patch)
tree59eb9ab2edae3f762391ad1814cef2fabccb9276 /tests/socket.test
parent053685ad2952fe7a83cf63ff28ec273862c903b3 (diff)
downloadtcl-a07a756335137e754bcd490da46a1cc1fd8df06c.zip
tcl-a07a756335137e754bcd490da46a1cc1fd8df06c.tar.gz
tcl-a07a756335137e754bcd490da46a1cc1fd8df06c.tar.bz2
Add tests for bugs [336441ed59] and [581937ab1e] from core-8-5-branch.
Diffstat (limited to 'tests/socket.test')
-rw-r--r--tests/socket.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/socket.test b/tests/socket.test
index 4fba2c3..e2e40f1 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -998,6 +998,35 @@ test socket_$af-8.1 {testing -async flag on sockets} -constraints [list socket s
close $s1
} -result bye
+test socket_$af-8.2 {testing writable event when quick failure} {socket win} {
+ # Test for bug 336441ed59 where a quick background fail was ignored
+
+ # Test only for windows as socket -async 255.255.255.255 fails directly
+ # on unix
+
+ # The following connect should fail very quickly
+ set a1 [after 2000 {set x timeout}]
+ set s [socket -async 255.255.255.255 43434]
+ fileevent $s writable {set x writable}
+ vwait x
+ catch {close $s}
+ after cancel $a1
+ set x
+} writable
+
+test socket_$af-8.3 {testing fileevent readable on failed async socket connect} {socket} {
+ # Test for bug 581937ab1e
+
+ set a1 [after 5000 {set x timeout}]
+ # This connect should fail
+ set s [socket -async localhost [randport]]
+ fileevent $s readable {set x readable}
+ vwait x
+ catch {close $s}
+ after cancel $a1
+ set x
+} readable
+
test socket_$af-9.1 {testing spurious events} -constraints [list socket supported_$af] -setup {
set len 0
set spurious 0