diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-14 07:33:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-14 07:33:42 (GMT) |
commit | 9a7583c2191aa650ad26a26ab89a94e644ac0240 (patch) | |
tree | 30a602b5e82e6c4be2a272103115d2f3ce5d992d /tests | |
parent | 4c0c6d80cd609403ceaf4f9c23984a42ab214d1d (diff) | |
download | tcl-9a7583c2191aa650ad26a26ab89a94e644ac0240.zip tcl-9a7583c2191aa650ad26a26ab89a94e644ac0240.tar.gz tcl-9a7583c2191aa650ad26a26ab89a94e644ac0240.tar.bz2 |
Fix [fe57ad096d97623e]: Fix test http-4.14 for tcl-8.6.11rc0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/http.test | 13 | ||||
-rw-r--r-- | tests/httpd | 10 | ||||
-rw-r--r-- | tests/httpold.test | 11 |
3 files changed, 15 insertions, 19 deletions
diff --git a/tests/http.test b/tests/http.test index d1b2d22..c45a45a 100644 --- a/tests/http.test +++ b/tests/http.test @@ -38,13 +38,10 @@ proc bgerror {args} { puts stderr $errorInfo } -if {$::tcl_platform(os) eq "Darwin"} { - # Name resolution often a problem on OSX; not focus of HTTP package anyway - set HOST localhost -} else { - set HOST [info hostname] -} - +# Do not use [info hostname]. +# Name resolution is often a problem on OSX; not focus of HTTP package anyway. +# Also a problem on other platforms for http-4.14 (test with bad port number). +set HOST localhost set port 8010 set bindata "This is binary data\x0d\x0amore\x0dmore\x0amore\x00null" catch {unset data} @@ -81,6 +78,8 @@ if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} { unset port return } else { + # Running httpd in the current thread overwrites the values of port + # (here) and HOST (in the sourced server file). set port [lindex [fconfigure $listen -sockname] 2] } } diff --git a/tests/httpd b/tests/httpd index 16e0382..4f5f600 100644 --- a/tests/httpd +++ b/tests/httpd @@ -10,12 +10,10 @@ #set httpLog 1 -if {$::tcl_platform(os) eq "Darwin"} { - # Name resolution often a problem on OSX; not focus of HTTP package anyway - set HOST localhost -} else { - set HOST [info hostname] -} +# Do not use [info hostname]. +# Name resolution is often a problem on OSX; not focus of HTTP package anyway. +# Also a problem on other platforms for http-4.14 (test with bad port number). +set HOST localhost proc httpd_init {{port 8015}} { socket -server httpdAccept $port diff --git a/tests/httpold.test b/tests/httpold.test index 1b07c90..e5d974c 100644 --- a/tests/httpold.test +++ b/tests/httpold.test @@ -33,18 +33,17 @@ if {[catch {package require http 1.0}]} { } } -if {$::tcl_platform(os) eq "Darwin"} { - # Name resolution often a problem on OSX; not focus of HTTP package anyway - set HOST localhost -} else { - set HOST [info hostname] -} +# Do not use [info hostname]. +# Name resolution is often a problem on OSX; not focus of HTTP package anyway. +# Also a problem on other platforms for http-4.14 (test with bad port number). +set HOST localhost set bindata "This is binary data\x0d\x0amore\x0dmore\x0amore\x00null" catch {unset data} ## ## The httpd script implement a stub http server +## Sourcing httpd overwrites the value of HOST. ## source [file join [file dirname [info script]] httpd] |