summaryrefslogtreecommitdiffstats
path: root/tests/socket.test
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-04-04 16:44:33 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-04-04 16:44:33 (GMT)
commita6d4c34ed0856aec3b66100021008f72a9fd8a28 (patch)
treeee100b0158bcfe734149ca471a672e208253e54f /tests/socket.test
parent83674895910aaf2ff10fd52075b53e39020d8568 (diff)
parentf0c184a069af5733133ae8b053918986b4cff221 (diff)
downloadtcl-a6d4c34ed0856aec3b66100021008f72a9fd8a28.zip
tcl-a6d4c34ed0856aec3b66100021008f72a9fd8a28.tar.gz
tcl-a6d4c34ed0856aec3b66100021008f72a9fd8a28.tar.bz2
Moved tests socket-8.2 and socket-8.3 to socket-14.3 and socket-14.4 and made them robust against connect failures
Diffstat (limited to 'tests/socket.test')
-rw-r--r--tests/socket.test60
1 files changed, 31 insertions, 29 deletions
diff --git a/tests/socket.test b/tests/socket.test
index a3d4b4b..1b7c5fa 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -914,35 +914,6 @@ test socket-8.1 {testing -async flag on sockets} {socket} {
set z
} bye
-test socket-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-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-9.1 {testing spurious events} {socket} {
set len 0
set spurious 0
@@ -1716,6 +1687,37 @@ if {[string match sock* $commandSocket] == 1} {
}
catch {close $commandSocket}
catch {close $remoteProcChan}
+test socket-14.13 {testing writable event when quick failure} -constraints {socket win supported_inet} -body {
+ # 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
+ set x
+} -cleanup {
+ catch {close $s}
+ after cancel $a1
+} -result writable
+
+test socket-14.14 {testing fileevent readable on failed async socket connect} -constraints [list socket] -body {
+ # 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
+ set x
+} -cleanup {
+ catch {close $s}
+ after cancel $a1
+} -result readable
+
::tcltest::cleanupTests
flush stdout
return