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