summaryrefslogtreecommitdiffstats
path: root/tests/send.test
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-08-30 01:51:42 (GMT)
committerhobbs <hobbs>2001-08-30 01:51:42 (GMT)
commitd45ee90a6079dd3725cbac6ad9791e316668a7fc (patch)
treebecbe0c994ea4eeed18765326efdf7f8fb2a8053 /tests/send.test
parent96adcf5aa5e6fac1276e40be17d81a0b366b4828 (diff)
downloadtk-d45ee90a6079dd3725cbac6ad9791e316668a7fc.zip
tk-d45ee90a6079dd3725cbac6ad9791e316668a7fc.tar.gz
tk-d45ee90a6079dd3725cbac6ad9791e316668a7fc.tar.bz2
corrected to use testConfig constraints in
the TK_ALT_DISPLAY case
Diffstat (limited to 'tests/send.test')
-rw-r--r--tests/send.test74
1 files changed, 37 insertions, 37 deletions
diff --git a/tests/send.test b/tests/send.test
index 816151e..c2263c2 100644
--- a/tests/send.test
+++ b/tests/send.test
@@ -7,12 +7,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: send.test,v 1.3 1999/04/16 01:51:40 stanton Exp $
+# RCS: @(#) $Id: send.test,v 1.4 2001/08/30 01:51:42 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
}
+# 'send' is only available on Unix...
+
if {$tcl_platform(platform) == "macintosh"} {
puts "send is not available on the Mac - skipping tests"
::tcltest::cleanupTests
@@ -29,6 +31,8 @@ if {[auto_execok xhost] == ""} {
return
}
+set ::tcltest::testConfig(altDisplay) [info exists env(TK_ALT_DISPLAY)]
+
if {[info commands testsend] == "testsend"} {
set gotTestCmds 1
} else {
@@ -249,22 +253,20 @@ test send-8.1 {Tk_SendCmd procedure, options} {
cleanupbg
lappend result $a
} {66 77}
-if [info exists env(TK_ALT_DISPLAY)] {
- test send-8.2 {Tk_SendCmd procedure, options} {
- setupbg -display $env(TK_ALT_DISPLAY)
- tk appname xyzgorp
- set a homeDisplay
- set result [dobg "
- toplevel .t -screen [winfo screen .]
- wm geometry .t +0+0
- set a altDisplay
- tk appname xyzgorp
- list \[send xyzgorp set a\] \[send -displayof .t xyzgorp set a\]
- "]
- cleanupbg
- set result
- } {altDisplay homeDisplay}
-}
+test send-8.2 {Tk_SendCmd procedure, options} {altDisplay} {
+ setupbg -display $env(TK_ALT_DISPLAY)
+ tk appname xyzgorp
+ set a homeDisplay
+ set result [dobg "
+ toplevel .t -screen [winfo screen .]
+ wm geometry .t +0+0
+ set a altDisplay
+ tk appname xyzgorp
+ list \[send xyzgorp set a\] \[send -displayof .t xyzgorp set a\]
+ "]
+ cleanupbg
+ set result
+} {altDisplay homeDisplay}
test send-8.3 {Tk_SendCmd procedure, options} {
list [catch {send -- -async foo bar baz} msg] $msg
} {1 {no application named "-async"}}
@@ -614,26 +616,24 @@ test send-13.2 {DeleteProc procedure} {
lappend result [winfo interps] [info commands send]
} {{} {} foo send}
-if [info exists env(TK_ALT_DISPLAY)] {
- test send-14.1 {SendRestrictProc procedure, sends crossing from different displays} {
- setupbg -display $env(TK_ALT_DISPLAY)
- set result [dobg "
- toplevel .t -screen [winfo screen .]
- wm geometry .t +0+0
- tk appname xyzgorp1
- set x child
- "]
- toplevel .t -screen $env(TK_ALT_DISPLAY)
- wm geometry .t +0+0
- tk appname xyzgorp2
- update
- set y parent
- set result [send -displayof .t xyzgorp1 {list $x [send -displayof .t xyzgorp2 set y]}]
- destroy .t
- cleanupbg
- set result
- } {child parent}
-}
+test send-14.1 {SendRestrictProc procedure, sends crossing from different displays} {altDisplay} {
+ setupbg -display $env(TK_ALT_DISPLAY)
+ set result [dobg "
+ toplevel .t -screen [winfo screen .]
+ wm geometry .t +0+0
+ tk appname xyzgorp1
+ set x child
+ "]
+ toplevel .t -screen $env(TK_ALT_DISPLAY)
+ wm geometry .t +0+0
+ tk appname xyzgorp2
+ update
+ set y parent
+ set result [send -displayof .t xyzgorp1 {list $x [send -displayof .t xyzgorp2 set y]}]
+ destroy .t
+ cleanupbg
+ set result
+} {child parent}
if $gotTestCmds {
testsend prop root InterpRegister $registry