diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/io.test | 18 | ||||
-rw-r--r-- | tests/ioCmd.test | 4 | ||||
-rw-r--r-- | tests/ioUtil.test | 44 | ||||
-rw-r--r-- | tests/socket.test | 48 |
4 files changed, 57 insertions, 57 deletions
diff --git a/tests/io.test b/tests/io.test index 767570c..dcee6c8 100644 --- a/tests/io.test +++ b/tests/io.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: io.test,v 1.1.2.6 1998/12/03 04:57:15 stanton Exp $ +# RCS: @(#) $Id: io.test,v 1.1.2.7 1998/12/10 18:27:07 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -5009,7 +5009,7 @@ test io-39.18 {Tcl_SetChannelOption, setting read mode independently} \ proc accept {s a p} {close $s} set s1 [socket -server accept 0] set port [lindex [fconfigure $s1 -sockname] 2] - set s2 [socket localhost $port] + set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto lf} set modes [fconfigure $s2 -translation] @@ -5022,7 +5022,7 @@ test io-39.19 {Tcl_SetChannelOption, setting read mode independently} \ proc accept {s a p} {close $s} set s1 [socket -server accept 0] set port [lindex [fconfigure $s1 -sockname] 2] - set s2 [socket localhost $port] + set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto crlf} set modes [fconfigure $s2 -translation] @@ -5035,7 +5035,7 @@ test io-39.20 {Tcl_SetChannelOption, setting read mode independently} \ proc accept {s a p} {close $s} set s1 [socket -server accept 0] set port [lindex [fconfigure $s1 -sockname] 2] - set s2 [socket localhost $port] + set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto cr} set modes [fconfigure $s2 -translation] @@ -5048,7 +5048,7 @@ test io-39.21 {Tcl_SetChannelOption, setting read mode independently} \ proc accept {s a p} {close $s} set s1 [socket -server accept 0] set port [lindex [fconfigure $s1 -sockname] 2] - set s2 [socket localhost $port] + set s2 [socket 127.0.0.1 $port] update fconfigure $s2 -translation {auto auto} set modes [fconfigure $s2 -translation] @@ -6535,7 +6535,7 @@ proc FcopyTestDone {bytes {error {}}} { test io-53.5 {CopyData: error during fcopy} {socket} { set listen [socket -server FcopyTestAccept 2828] set in [open [info script]] ;# 126 K - set out [socket localhost 2828] + set out [socket 127.0.0.1 2828] catch {unset fcopyTestDone} close $listen ;# This means the socket open never really succeeds fcopy $in $out -command FcopyTestDone @@ -6649,7 +6649,7 @@ test io-54.2 {Testing for busy-wait in recursive channel events} {socket} { proc producer {} { global writer - set writer [socket localhost 3939] + set writer [socket 127.0.0.1 3939] fconfigure $writer -buffering line puts -nonewline $writer hello flush $writer @@ -6711,7 +6711,7 @@ test io-57.1 {buffered data and file events, gets} { set ::s2 $sock } set server [socket -server accept 4040] - set s [socket localhost 4040] + set s [socket 127.0.0.1 4040] vwait s2 update fileevent $s2 readable {lappend result readable} @@ -6732,7 +6732,7 @@ test io-57.2 {buffered data and file events, read} { set ::s2 $sock } set server [socket -server accept 4041] - set s [socket localhost 4041] + set s [socket 127.0.0.1 4041] vwait s2 update fileevent $s2 readable {lappend result readable} diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 223be22..067133a 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ioCmd.test,v 1.1.2.2 1998/09/24 23:59:28 stanton Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.1.2.3 1998/12/10 18:27:09 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -250,7 +250,7 @@ proc iocmdSSETUP {} { set srv [socket -server iocmdSRV 0]; set port [lindex [fconfigure $srv -sockname] 2]; proc iocmdSRV {sock ip port} {close $sock} - set cli [socket localhost $port]; + set cli [socket 127.0.0.1 $port]; } } proc iocmdSSHTDWN {} { diff --git a/tests/ioUtil.test b/tests/ioUtil.test index 349733a..8f5801b 100644 --- a/tests/ioUtil.test +++ b/tests/ioUtil.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ioUtil.test,v 1.1.2.2 1998/12/02 03:13:33 stanton Exp $ +# RCS: @(#) $Id: ioUtil.test,v 1.1.2.3 1998/12/10 18:27:09 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -18,7 +18,7 @@ set unsetScript { catch {unset testStat3(size)} } -test stat-1.1 {TclStat: Check that none of the test procs are there.} { +test ioUtil-1.1 {TclStat: Check that none of the test procs are there.} {knownBug} { catch {file stat testStat1%.fil testStat1} err1 catch {file stat testStat2%.fil testStat2} err2 catch {file stat testStat3%.fil testStat3} err3 @@ -29,7 +29,7 @@ if {[info commands teststatproc] == {}} { puts "This application hasn't been compiled with the \"teststatproc\"" puts "command, so I can't test Tcl_Stat_* etc." } else { -test stat-1.2 {TclStatInsertProc: Insert the 3 test TclStat_ procedures.} { +test ioUtil-1.2 {TclStatInsertProc: Insert the 3 test TclStat_ procedures.} { catch {teststatproc insert TclpStat} err1 teststatproc insert TestStatProc1 teststatproc insert TestStatProc2 @@ -37,7 +37,7 @@ test stat-1.2 {TclStatInsertProc: Insert the 3 test TclStat_ procedures.} { set err1 } {bad arg "insert": must be TestStatProc1, TestStatProc2, or TestStatProc3} -test stat-1.3 {TclStat: Use "file stat ?" to invoke each procedure.} { +test ioUtil-1.3 {TclStat: Use "file stat ?" to invoke each procedure.} {knownBug} { file stat testStat2%.fil testStat2 file stat testStat1%.fil testStat1 file stat testStat3%.fil testStat3 @@ -47,12 +47,12 @@ test stat-1.3 {TclStat: Use "file stat ?" to invoke each procedure.} { eval $unsetScript -test stat-1.4 {TclStatDeleteProc: "TclpStat" function should not be deletedable.} { +test ioUtil-1.4 {TclStatDeleteProc: "TclpStat" function should not be deletedable.} { catch {teststatproc delete TclpStat} err2 set err2 } {"TclpStat": could not be deleteed} -test stat-1.5 {TclStatDeleteProc: Delete the 2nd TclStat procedure.} { +test ioUtil-1.5 {TclStatDeleteProc: Delete the 2nd TclStat procedure.} {knownBug} { # Delete the 2nd procedure and test that it longer exists but that # the others do actually return a result. @@ -66,7 +66,7 @@ test stat-1.5 {TclStatDeleteProc: Delete the 2nd TclStat procedure.} { eval $unsetScript -test stat-1.6 {TclStatDeleteProc: Delete the 1st TclStat procedure.} { +test ioUtil-1.6 {TclStatDeleteProc: Delete the 1st TclStat procedure.} {knownBug} { # Next delete the 1st procedure and test that only the 3rd procedure # is the only one that exists. @@ -80,7 +80,7 @@ test stat-1.6 {TclStatDeleteProc: Delete the 1st TclStat procedure.} { eval $unsetScript -test stat-1.7 {TclStatDeleteProc: Delete the 3rd procedure & verify all are gone.} { +test ioUtil-1.7 {TclStatDeleteProc: Delete the 3rd procedure & verify all are gone.} {knownBug} { # Finally delete the 3rd procedure and check that none of the # procedures exist. @@ -94,7 +94,7 @@ test stat-1.7 {TclStatDeleteProc: Delete the 3rd procedure & verify all are gone eval $unsetScript -test stat-1.8 {TclStatDeleteProc: Verify that all procs have been deleted.} { +test ioUtil-1.8 {TclStatDeleteProc: Verify that all procs have been deleted.} {knownBug} { # Attempt to delete all the Stat procs. again to ensure they no longer # exist and an error is returned. @@ -120,7 +120,7 @@ if {[info commands testaccessproc] == {}} { puts "This application hasn't been compiled with the \"testaccessproc\"" puts "command, so I can't test Tcl_Access_* etc." } else { -test access-1.2 {TclAccessInsertProc: Insert the 3 test TclAccess_ procedures.} { +test ioUtil-1.2 {TclAccessInsertProc: Insert the 3 test TclAccess_ procedures.} { catch {testaccessproc insert TclpAccess} err1 testaccessproc insert TestAccessProc1 testaccessproc insert TestAccessProc2 @@ -128,14 +128,14 @@ test access-1.2 {TclAccessInsertProc: Insert the 3 test TclAccess_ procedures.} set err1 } {bad arg "insert": must be TestAccessProc1, TestAccessProc2, or TestAccessProc3} -test access-1.3 {TclAccess: Use "file access ?" to invoke each procedure.} { +test ioUtil-2.3 {TclAccess: Use "file access ?" to invoke each procedure.} { list \ [file exists testAccess2%.fil] \ [file exists testAccess1%.fil] \ [file exists testAccess3%.fil] } {1 1 1} -test access-1.4 {TclAccessDeleteProc: "TclpAccess" function should not be deletedable.} { +test ioUtil-2.4 {TclAccessDeleteProc: "TclpAccess" function should not be deletedable.} { catch {testaccessproc delete TclpAccess} err2 set err2 } {"TclpAccess": could not be deleteed} @@ -152,7 +152,7 @@ test accesst-1.5 {TclAccessDeleteProc: Delete the 2nd TclAccess procedure.} { list $res1 $err3 $res2 } {1 0 1} -test access-1.6 {TclAccessDeleteProc: Delete the 1st TclAccess procedure.} { +test ioUtil-2.6 {TclAccessDeleteProc: Delete the 1st TclAccess procedure.} { # Next delete the 1st procedure and test that only the 3rd procedure # is the only one that exists. @@ -164,7 +164,7 @@ test access-1.6 {TclAccessDeleteProc: Delete the 1st TclAccess procedure.} { list $err4 $err5 $res3 } {0 0 1} -test access-1.7 {TclAccessDeleteProc: Delete the 3rd procedure & verify all are gone.} { +test ioUtil-2.7 {TclAccessDeleteProc: Delete the 3rd procedure & verify all are gone.} { # Finally delete the 3rd procedure and check that none of the # procedures exist. @@ -176,7 +176,7 @@ test access-1.7 {TclAccessDeleteProc: Delete the 3rd procedure & verify all are list $err6 $err7 $err8 } {0 0 0} -test access-1.8 {TclAccessDeleteProc: Verify that all procs have been deleted.} { +test ioUtil-2.8 {TclAccessDeleteProc: Verify that all procs have been deleted.} { # Attempt to delete all the Access procs. again to ensure they no longer # exist and an error is returned. @@ -188,7 +188,7 @@ test access-1.8 {TclAccessDeleteProc: Verify that all procs have been deleted.} } {{"TestAccessProc1": could not be deleteed} {"TestAccessProc2": could not be deleteed} {"TestAccessProc3": could not be deleteed}} } -test openfilechannel-1.1 {TclOpenFileChannel: Check that none of the test procs are there.} { +test ioUtil-3.1 {TclOpenFileChannel: Check that none of the test procs are there.} { catch {file exists __testOpenFileChannel1%__.fil} err1 catch {file exists __testOpenFileChannel2%__.fil} err2 catch {file exists __testOpenFileChannel3%__.fil} err3 @@ -202,7 +202,7 @@ if {[info commands testopenfilechannelproc] == {}} { puts "This application hasn't been compiled with the \"testopenfilechannelproc\"" puts "command, so I can't test Tcl_OpenFileChannelInsert" } else { -test openfilechannel-1.2 {TclOpenFileChannelInsertProc: Insert the 3 test TclOpenFileChannel_ procedures.} { +test ioUtil-3.2 {TclOpenFileChannelInsertProc: Insert the 3 test TclOpenFileChannel_ procedures.} { catch {testopenfilechannelproc insert TclpOpenFileChannel} err1 testopenfilechannelproc insert TestOpenFileChannelProc1 testopenfilechannelproc insert TestOpenFileChannelProc2 @@ -210,7 +210,7 @@ test openfilechannel-1.2 {TclOpenFileChannelInsertProc: Insert the 3 test TclOpe set err1 } {bad arg "insert": must be TestOpenFileChannelProc1, TestOpenFileChannelProc2, or TestOpenFileChannelProc3} -test openfilechannel-1.3 {TclOpenFileChannel: Use "file openfilechannel ?" to invoke each procedure.} { +test ioUtil-3.3 {TclOpenFileChannel: Use "file openfilechannel ?" to invoke each procedure.} { close [open __testOpenFileChannel1%__.fil w] close [open __testOpenFileChannel2%__.fil w] close [open __testOpenFileChannel3%__.fil w] @@ -228,7 +228,7 @@ test openfilechannel-1.3 {TclOpenFileChannel: Use "file openfilechannel ?" to in set err } {} -test openfilechannel-1.4 {TclOpenFileChannelDeleteProc: "TclpOpenFileChannel" function should not be deletedable.} { +test ioUtil-3.4 {TclOpenFileChannelDeleteProc: "TclpOpenFileChannel" function should not be deletedable.} { catch {testopenfilechannelproc delete TclpOpenFileChannel} err2 set err2 } {"TclpOpenFileChannel": could not be deleteed} @@ -254,7 +254,7 @@ test openfilechannelt-1.5 {TclOpenFileChannelDeleteProc: Delete the 2nd TclOpenF set err3 } {} -test openfilechannel-1.6 {TclOpenFileChannelDeleteProc: Delete the 1st TclOpenFileChannel procedure.} { +test ioUtil-3.6 {TclOpenFileChannelDeleteProc: Delete the 1st TclOpenFileChannel procedure.} { # Next delete the 1st procedure and test that only the 3rd procedure # is the only one that exists. @@ -273,7 +273,7 @@ test openfilechannel-1.6 {TclOpenFileChannelDeleteProc: Delete the 1st TclOpenFi set err4 } {} -test openfilechannel-1.7 {TclOpenFileChannelDeleteProc: Delete the 3rd procedure & verify all are gone.} { +test ioUtil-3.7 {TclOpenFileChannelDeleteProc: Delete the 3rd procedure & verify all are gone.} { # Finally delete the 3rd procedure and check that none of the # procedures exist. @@ -287,7 +287,7 @@ test openfilechannel-1.7 {TclOpenFileChannelDeleteProc: Delete the 3rd procedure set err5 } {1} -test openfilechannel-1.8 {TclOpenFileChannelDeleteProc: Verify that all procs have been deleted.} { +test ioUtil-3.8 {TclOpenFileChannelDeleteProc: Verify that all procs have been deleted.} { # Attempt to delete all the OpenFileChannel procs. again to ensure they no longer # exist and an error is returned. diff --git a/tests/socket.test b/tests/socket.test index eef6557..2483ab5 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -59,7 +59,7 @@ # listening at port 2048. If all fails, a message is printed and the tests # using the remote server are not performed. # -# RCS: @(#) $Id: socket.test,v 1.1.2.3 1998/12/04 01:19:35 stanton Exp $ +# RCS: @(#) $Id: socket.test,v 1.1.2.4 1998/12/10 18:27:10 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -93,7 +93,7 @@ if {![info exists remoteServerPort]} { set doTestsWithRemoteServer 1 if {![info exists remoteServerIP] && ($tcl_platform(platform) != "macintosh")} { - set remoteServerIP localhost + set remoteServerIP 127.0.0.1 } if {($doTestsWithRemoteServer == 1) && (![info exists remoteServerPort])} { set remoteServerPort 2048 @@ -119,7 +119,7 @@ if {$doTestsWithRemoteServer} { set noRemoteTestReason "\ncan't run multiple instances of tcltest under win32s." set doTestsWithRemoteServer 0 } else { - set remoteServerIP localhost + set remoteServerIP 127.0.0.1 if {[catch {set remoteProcChan \ [open "|[list $tcltest remote.tcl \ -serverIsSilent \ @@ -259,7 +259,7 @@ test socket-2.1 {tcp connection} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f x - if {[catch {socket localhost 2828} msg]} { + if {[catch {socket 127.0.0.1 2828} msg]} { set x $msg } else { lappend x [gets $f] @@ -296,9 +296,9 @@ test socket-2.2 {tcp connection with client port specified} {stdio} { set f [open "|[list $tcltest script]" r] gets $f x global port - if {[catch {socket -myport $port localhost 2828} sock]} { + if {[catch {socket -myport $port 127.0.0.1 2828} sock]} { set x $sock - close [socket localhost 2828] + close [socket 127.0.0.1 2828] puts stderr $sock } else { puts $sock hello @@ -329,7 +329,7 @@ test socket-2.3 {tcp connection with client interface specified} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f x - if {[catch {socket -myaddr localhost localhost 2828} sock]} { + if {[catch {socket -myaddr 127.0.0.1 127.0.0.1 2828} sock]} { set x $sock } else { puts $sock hello @@ -391,7 +391,7 @@ test socket-2.5 {tcp connection with redundant server port} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f x - if {[catch {socket localhost 2828} sock]} { + if {[catch {socket 127.0.0.1 2828} sock]} { set x $sock } else { puts $sock hello @@ -404,7 +404,7 @@ test socket-2.5 {tcp connection with redundant server port} {stdio} { } {ready hello} test socket-2.6 {tcp connection} {} { set status ok - if {![catch {set sock [socket localhost 2828]}]} { + if {![catch {set sock [socket 127.0.0.1 2828]}]} { if {![catch {gets $sock}]} { set status broken } @@ -441,7 +441,7 @@ test socket-2.7 {echo server, one line} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f - set s [socket localhost 2828] + set s [socket 127.0.0.1 2828] fconfigure $s -buffering line -translation lf puts $s "hello abcdefghijklmnop" set x [gets $s] @@ -482,7 +482,7 @@ test socket-2.8 {echo server, loop 50 times, single connection} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f - set s [socket localhost 2828] + set s [socket 127.0.0.1 2828] fconfigure $s -buffering line catch { for {set x 0} {$x < 50} {incr x} { @@ -542,7 +542,7 @@ test socket-2.11 {detecting new data} { set s [socket -server accept 2400] set sock "" - set s2 [socket localhost 2400] + set s2 [socket 127.0.0.1 2400] vwait sock puts $s2 one flush $s2 @@ -617,11 +617,11 @@ test socket-3.2 {server with several clients} {stdio} { close $f set f [open "|[list $tcltest script]" r+] set x [gets $f] - set s1 [socket localhost 2828] + set s1 [socket 127.0.0.1 2828] fconfigure $s1 -buffering line - set s2 [socket localhost 2828] + set s2 [socket 127.0.0.1 2828] fconfigure $s2 -buffering line - set s3 [socket localhost 2828] + set s3 [socket 127.0.0.1 2828] fconfigure $s3 -buffering line for {set i 0} {$i < 100} {incr i} { puts $s1 hello,s1 @@ -644,7 +644,7 @@ test socket-4.1 {server with several clients} {stdio} { set f [open script w] puts $f { gets stdin - set s [socket localhost 2828] + set s [socket 127.0.0.1 2828] fconfigure $s -buffering line for {set i 0} {$i < 100} {incr i} { puts $s hello @@ -747,7 +747,7 @@ test socket-6.1 {accept callback error} {stdio} { set f [open script w] puts $f { gets stdin - socket localhost 2848 + socket 127.0.0.1 2848 } close $f set f [open "|[list $tcltest script]" r+] @@ -784,7 +784,7 @@ test socket-7.1 {testing socket specific options} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f - set s [socket localhost 2820] + set s [socket 127.0.0.1 2820] set p [fconfigure $s -peername] close $s close $f @@ -810,7 +810,7 @@ test socket-7.2 {testing socket specific options} {stdio} { close $f set f [open "|[list $tcltest script]" r] gets $f - set s [socket localhost 2821] + set s [socket 127.0.0.1 2821] set p [fconfigure $s -sockname] close $s close $f @@ -849,7 +849,7 @@ test socket-7.5 {testing socket specific options} {unixOrPc} { set x [fconfigure $s -sockname] close $s } - set s1 [socket localhost 2829] + set s1 [socket 127.0.0.1 2829] set timer [after 10000 "set x timed_out"] vwait x after cancel $timer @@ -1016,7 +1016,7 @@ test socket-10.1 {testing socket accept callback error handling} { proc bgerror args {global goterror; set goterror 1} set s [socket -server accept 2898] proc accept {s a p} {close $s; error} - set c [socket localhost 2898] + set c [socket 127.0.0.1 2898] vwait goterror close $s close $c @@ -1412,7 +1412,7 @@ test socket-12.1 {testing inheritance of server sockets} { # If we can still connect to the server, the socket got inherited. - if {[catch {socket localhost 2828} msg]} { + if {[catch {socket 127.0.0.1 2828} msg]} { set x {server socket was not inherited} } else { close $msg @@ -1444,7 +1444,7 @@ test socket-12.2 {testing inheritance of client sockets} { set f [open script2 w] puts $f [list set tcltest $tcltest] puts $f { - set f [socket localhost 2829] + set f [socket 127.0.0.1 2829] exec $tcltest script1 & puts $f testing flush $f @@ -1541,7 +1541,7 @@ test socket-12.3 {testing inheritance of accepted sockets} { after 1000 set ok_to_proceed 1 vwait ok_to_proceed - set f [socket localhost 2930] + set f [socket 127.0.0.1 2930] fconfigure $f -buffering full -blocking 0 fileevent $f readable [list getdata $f] |