1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#
# socket.test
#
# Test for socket and network related commands.
#------------------------------------------------------------------------------
# Copyright 1992-1999 Karl Lehenbauer and Mark Diekhans.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies. Karl Lehenbauer and
# Mark Diekhans make no representations about the suitability of this
# software for any purpose. It is provided "as is" without express or
# implied warranty.
#------------------------------------------------------------------------------
# $Id: socket.test,v 1.2 2002/04/02 02:29:43 hobbs Exp $
#------------------------------------------------------------------------------
#
if {[cequal [info procs Test] {}]} {
source [file join [file dirname [info script]] testlib.tcl]
}
if [cequal $tcl_platform(platform) windows] {
echo " * The socket tests have not been ported to Win32"
return
}
#
# Do all argument and error checking. We can at least test this, even
# if we can't run full tests on this particular system.
#
Test socket-1.0 {host_info argument checking} {
host_info
} 1 {wrong # args: host_info option ...}
Test socket-1.1 {host_info argument checking} {
host_info addresses
} 1 {wrong # args: host_info addresses host}
Test socket-1.2 {host_info argument checking} {
host_info addresses xxx yyy
} 1 {wrong # args: host_info addresses host}
Test socket-1.3 {host_info argument checking} {
host_info bad localhost
} 1 {invalid option "bad", expected one of "addresses", "official_name", or "aliases"}
#
# Determine if we are at a development site we know is good. If we are, we
# do more checking.
#
switch -glob -- [id host] {
{*.neosoft.com} {set safeHost 1}
{*.grizzly.com} {set safeHost 1}
default {set safeHost 0}
}
if [info exists env(TCLX_FULL_TESTS)] {
set safeHost 1
}
# FIX: Add hostinfo tests.
# cleanup
::tcltest::cleanupTests
return
|