summaryrefslogtreecommitdiffstats
path: root/tests/socket.test
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-10-17 12:28:55 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-10-17 12:28:55 (GMT)
commitd7604e5728758d9d4d1efb8124548d3df914bf9b (patch)
tree5c0a549e46d73adae7e07d43fc18b1e82183279c /tests/socket.test
parent8e5b3b87a5b56c5d871a6d7e2107a516ca1d6212 (diff)
downloadtcl-d7604e5728758d9d4d1efb8124548d3df914bf9b.zip
tcl-d7604e5728758d9d4d1efb8124548d3df914bf9b.tar.gz
tcl-d7604e5728758d9d4d1efb8124548d3df914bf9b.tar.bz2
New tests: 14.16: -peername empty while async connect running, 14.17: -sockname
Diffstat (limited to 'tests/socket.test')
-rw-r--r--tests/socket.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/socket.test b/tests/socket.test
index c50730c..d6cee30 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -2321,6 +2321,28 @@ test socket-14.15 {blocking read on async socket should not trigger event handle
set x
} -result ok
+# v4 and v6 is required to prevent that the async connect does not terminate
+# before the fconfigure command. There is always an additional ip to try.
+test socket-14.16 {empty -peername while [socket -async] connecting} \
+ -constraints {socket localhost_v4 localhost_v6} \
+ -body {
+ set client [socket -async localhost [randport]]
+ fconfigure $client -peername
+ } -cleanup {
+ catch {close $client}
+ } -result {}
+
+# v4 and v6 is required to prevent that the async connect does not terminate
+# before the fconfigure command. There is always an additional ip to try.
+test socket-14.17 {empty -sockname while [socket -async] connecting} \
+ -constraints {socket localhost_v4 localhost_v6} \
+ -body {
+ set client [socket -async localhost [randport]]
+ fconfigure $client -sockname
+ } -cleanup {
+ catch {close $client}
+ } -result {}
+
set num 0
set x {localhost {socket} 127.0.0.1 {supported_inet} ::1 {supported_inet6}}