summaryrefslogtreecommitdiffstats
path: root/tests/socket.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/socket.test')
-rw-r--r--tests/socket.test29
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/socket.test b/tests/socket.test
index 363f141..8efa79e 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -1718,7 +1718,7 @@ catch {close $commandSocket}
catch {close $remoteProcChan}
}
unset ::tcl::unsupported::socketAF
-test socket-14.0 {[socket -async] when server only listens on one address family} \
+test socket-14.0 {[socket -async] when server only listens on IPv4} \
-constraints [list socket supported_any] \
-setup {
proc accept {s a p} {
@@ -1784,23 +1784,28 @@ test socket-14.2 {[socket -async] fileevent connection refused} \
close $client
unset x
} -result "connection refused"
-test socket-14.3 {[socket -async] fileevent host unreachable} \
+test socket-14.3 {[socket -async] when server only listens on IPv6} \
-constraints [list socket supported_any] \
- -body {
- # address from rfc5737
- set client [socket -async 192.0.2.42 [randport]]
- fileevent $client writable {set x [fconfigure $client -error]}
- set after [after 5000 {set x timeout}]
- vwait x
- if {$x eq "timeout"} {
- append x ": [fconfigure $client -error]"
+ -setup {
+ proc accept {s a p} {
+ global x
+ puts $s bye
+ close $s
+ set x ok
}
+ set server [socket -server accept -myaddr ::1 0]
+ set port [lindex [fconfigure $server -sockname] 2]
+ } -body {
+ set client [socket -async localhost $port]
+ set after [after 1000 {set x [fconfigure $client -error]}]
+ vwait x
set x
} -cleanup {
after cancel $after
+ close $server
close $client
unset x
- } -result "host is unreachable"
+ } -result ok
test socket-14.4 {[socket -async] and both, readdable and writable fileevents} \
-constraints [list socket supported_any] \
-setup {
@@ -1832,7 +1837,7 @@ test socket-14.5 {[socket -async] which fails before any connect() can be made}
-constraints [list socket supported_any] \
-body {
# addresses from rfc5737
- socket -async -myaddr 192.0.2.42 198.51.100.42 [randport]
+ socket -async -myaddr 192.0.2.42 127.0.0.1 [randport]
} \
-returnCodes 1 \
-result {couldn't open socket: cannot assign requested address}