summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--tests/socket.test21
2 files changed, 15 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index fd02eff..06cd5d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-05-03 Don Porter <dgp@users.sourceforge.net>
+ * tests/socket.test: [Bug 3428754] Test socket-14.2 tolerate
+ [socket -async] connection that connects synchronously.
+
* unix/tclUnixSock.c: [Bug 3428753] Fix [socket -async] connections
that manage to connect synchronously.
diff --git a/tests/socket.test b/tests/socket.test
index f63f5ca..f06a548 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -1776,17 +1776,20 @@ test socket-14.1 {[socket -async] fileevent while still connecting} \
test socket-14.2 {[socket -async] fileevent connection refused} \
-constraints [list socket supported_any] \
-body {
- set client [socket -async localhost [randport]]
- fileevent $client writable {set x [fconfigure $client -error]}
- set after [after 1000 {set x timeout}]
- vwait x
- if {$x eq "timeout"} {
- append x ": [fconfigure $client -error]"
- }
+ if {[catch {socket -async localhost [randport]} client]} {
+ regexp {[^:]*: (.*)} $client -> x
+ } else {
+ fileevent $client writable {set x [fconfigure $client -error]}
+ set after [after 1000 {set x timeout}]
+ vwait x
+ after cancel $after
+ if {$x eq "timeout"} {
+ append x ": [fconfigure $client -error]"
+ }
+ close $client
+ }
set x
} -cleanup {
- after cancel $after
- close $client
unset x
} -result "connection refused"
test socket-14.3 {[socket -async] when server only listens on IPv6} \