summaryrefslogtreecommitdiffstats
path: root/tests/unixEmbed.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-07-13 20:28:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-07-13 20:28:35 (GMT)
commit05961d4dc9e4b65d07feac195998ca0f969b06d9 (patch)
tree83ce372d1ae9d46d27acc5638739bddcbc8e6ba6 /tests/unixEmbed.test
parent511415799ba6bf2ec3e5d90c57dfbb61da8c6da1 (diff)
downloadtk-05961d4dc9e4b65d07feac195998ca0f969b06d9.zip
tk-05961d4dc9e4b65d07feac195998ca0f969b06d9.tar.gz
tk-05961d4dc9e4b65d07feac195998ca0f969b06d9.tar.bz2
* Converted more files to tcltest and factored out common code.
Diffstat (limited to 'tests/unixEmbed.test')
-rw-r--r--tests/unixEmbed.test125
1 files changed, 32 insertions, 93 deletions
diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test
index 851cba6..8b3cede 100644
--- a/tests/unixEmbed.test
+++ b/tests/unixEmbed.test
@@ -6,21 +6,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: unixEmbed.test,v 1.9 2002/07/12 13:40:59 dgp Exp $
+# RCS: @(#) $Id: unixEmbed.test,v 1.10 2002/07/13 20:28:35 dgp Exp $
package require tcltest 2.1
-namespace import -force tcltest::test
-namespace import -force tcltest::testConstraint
-namespace import -force tcltest::testsDirectory
namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
configure -testdir [file join [pwd] [file dirname [info script]]]
configure -loadfile [file join [testsDirectory] constraints.tcl]
tcltest::loadTestedCommands
-eval configure $argv
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
setupbg
dobg {wm withdraw .}
@@ -101,7 +94,7 @@ test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} {unix nonPortab
testConstraint testembed [llength [info commands testembed]]
test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {unix testembed} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -113,7 +106,7 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {unix te
}
} {{{XXX {} {} .t}} 0}
test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} {unix testembed} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -127,7 +120,7 @@ test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} {unix te
}
} {{XXX {} {} .t2} {XXX {} {} .t1}}
test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} {unix testembed} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -140,9 +133,7 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app}
# TkpMakeContainer, or EmbedErrorProc.
test unixEmbed-2.1 {EmbeddedEventProc procedure} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -158,9 +149,7 @@ test unixEmbed-2.1 {EmbeddedEventProc procedure} {unix testembed} {
}
} {}
test unixEmbed-2.2 {EmbeddedEventProc procedure} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -173,9 +162,7 @@ test unixEmbed-2.2 {EmbeddedEventProc procedure} {unix testembed} {
}
} {}
test unixEmbed-2.3 {EmbeddedEventProc procedure} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -184,9 +171,7 @@ test unixEmbed-2.3 {EmbeddedEventProc procedure} {unix testembed} {
testembed
} {}
test unixEmbed-2.4 {EmbeddedEventProc procedure} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -199,9 +184,7 @@ test unixEmbed-2.4 {EmbeddedEventProc procedure} {unix testembed} {
test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} \
{unix testembed nonPortable} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -214,9 +197,7 @@ test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} \
list $x [testembed]
} {{{XXX .f1 {} {}}} {{XXX .f1 XXX {}}}}
test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
toplevel .t1 -container 1
wm geometry .t1 +0+0
toplevel .t2 -use [winfo id .t1] -bg red
@@ -224,9 +205,7 @@ test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} unix {
wm geometry .t2
} {200x200+0+0}
test unixEmbed-3.2 {ContainerEventProc procedure, disallow position changes} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -242,9 +221,7 @@ test unixEmbed-3.2 {ContainerEventProc procedure, disallow position changes} uni
}
} {200x200+0+0}
test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -260,9 +237,7 @@ test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} uni
}
} {300x100+0+0}
test unixEmbed-3.4 {ContainerEventProc procedure, geometry requests} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -278,9 +253,7 @@ test unixEmbed-3.4 {ContainerEventProc procedure, geometry requests} unix {
list [winfo width .f1] [winfo height .f1] [dobg {wm geometry .t1}]
} {300 80 300x80+0+0}
test unixEmbed-3.5 {ContainerEventProc procedure, map requests} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -298,9 +271,7 @@ test unixEmbed-3.5 {ContainerEventProc procedure, map requests} unix {
}
} {mapped}
test unixEmbed-3.6 {ContainerEventProc procedure, destroy events} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -319,9 +290,7 @@ test unixEmbed-3.6 {ContainerEventProc procedure, destroy events} unix {
} {dead 0}
test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -339,9 +308,7 @@ test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} unix {
}
} {180x100+0+0}
test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -356,9 +323,7 @@ test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} {unix testembe
} {{{XXX .f1 XXX {}}} {}}
test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -374,9 +339,7 @@ test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} unix {
dobg {set x}
} {{focus in .t1}}
test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -393,9 +356,7 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} unix {
update
} {}
test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -415,9 +376,7 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} unix {
} {{{focus in .t1}} {{focus in .t1} {focus out .t1}}}
test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -435,9 +394,7 @@ test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} unix {
}
} {{{configure .t1 300 120}} 300x120+0+0}
test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
place .f1 -width 200 -height 200
dobg "set w1 [winfo id .f1]"
@@ -459,9 +416,7 @@ test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} unix {
# Can't think up any tests for TkpGetOtherWindow procedure.
test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -484,9 +439,7 @@ test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} unix {
list $x $y
} {{{key a 1}} {}}
test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -512,9 +465,7 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width
} {{} {{key b}}}
test unixEmbed-8.1 {TkpClaimFocus procedure} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
@@ -536,9 +487,7 @@ test unixEmbed-8.1 {TkpClaimFocus procedure} unix {
} {{{} .t1} .f1}
test unixEmbed-8.2 {TkpClaimFocus procedure} unix {
catch {interp delete child}
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
@@ -560,9 +509,7 @@ test unixEmbed-8.2 {TkpClaimFocus procedure} unix {
catch {interp delete child}
test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
frame .f3 -container 1 -width 200 -height 50
@@ -577,9 +524,7 @@ test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {unix testemb
set x
} {{{XXX .f4 {} {}} {XXX .f3 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f4 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}}} {}}
test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} {unix testembed} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -594,9 +539,7 @@ test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} {unix teste
} {{{XXX {} {} .t1}} {}}
test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -606,9 +549,7 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix
wm geometry .t1
} {150x80+0+0}
test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -619,9 +560,7 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix
} {70x300+0+0}
# cleanup
-foreach w [winfo child .] {
- catch {destroy $w}
-}
+deleteWindows
cleanupbg
::tcltest::cleanupTests
return