summaryrefslogtreecommitdiffstats
path: root/tests/macEmbed.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/macEmbed.test')
-rw-r--r--tests/macEmbed.test88
1 files changed, 26 insertions, 62 deletions
diff --git a/tests/macEmbed.test b/tests/macEmbed.test
index b6c2f68..bd9cdbc 100644
--- a/tests/macEmbed.test
+++ b/tests/macEmbed.test
@@ -6,16 +6,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: macEmbed.test,v 1.5 2001/03/28 17:27:10 dgp Exp $
-
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+# RCS: @(#) $Id: macEmbed.test,v 1.6 2002/07/13 20:28:35 dgp Exp $
+package require tcltest 2.1
+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
test macEmbed-1.1 {TkpUseWindow procedure, bad window identifier} {macOnly} {
catch {destroy .t}
@@ -34,7 +32,7 @@ if {[string compare testembed [info commands testembed]] != 0} {
}
test macEmbed-1.3 {TkpUseWindow procedure, creating Container records} {macOnly} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -43,7 +41,7 @@ test macEmbed-1.3 {TkpUseWindow procedure, creating Container records} {macOnly}
list [testembed] [expr [lindex [lindex [testembed all] 1] 0] - $w]
} {{{XXX .f2 {} {}} {XXX .f1 XXX .t}} 0}
test macEmbed-1.4 {TkpUseWindow procedure, creating Container records} {macOnly} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -58,9 +56,7 @@ test macEmbed-1.4 {TkpUseWindow procedure, creating Container records} {macOnly}
# TkpMakeContainer, or EmbedErrorProc.
test macEmbed-2.1 {EmbeddedEventProc procedure} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -71,9 +67,7 @@ test macEmbed-2.1 {EmbeddedEventProc procedure} {macOnly} {
testembed
} {}
test macEmbed-2.2 {EmbeddedEventProc procedure} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -82,9 +76,7 @@ test macEmbed-2.2 {EmbeddedEventProc procedure} {macOnly} {
testembed
} {}
test macEmbed-2.3 {EmbeddedEventProc procedure} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -95,9 +87,7 @@ test macEmbed-2.3 {EmbeddedEventProc procedure} {macOnly} {
} {{} {}}
test macEmbed-3.1 {EmbeddedEventProc procedure, detect creation} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -108,9 +98,7 @@ test macEmbed-3.1 {EmbeddedEventProc procedure, detect creation} {macOnly} {
} {{{XXX .f1 {} {}}} {{XXX .f1 XXX .t1}}}
test macEmbed-3.2 {EmbeddedEventProc procedure, disallow position changes} \
{macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -122,9 +110,7 @@ test macEmbed-3.2 {EmbeddedEventProc procedure, disallow position changes} \
} {200x200+0+0}
test macEmbed-3.3 {EmbeddedEventProc procedure, disallow position changes} \
{macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -135,9 +121,7 @@ test macEmbed-3.3 {EmbeddedEventProc procedure, disallow position changes} \
wm geometry .t1
} {300x100+0+0}
test macEmbed-3.4 {EmbeddedEventProc procedure, geometry requests} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
toplevel .t1 -container 1 -width 200 -height 50
set w1 [winfo id .t1]
toplevel .t2 -use $w1
@@ -147,9 +131,7 @@ test macEmbed-3.4 {EmbeddedEventProc procedure, geometry requests} {macOnly} {
list [winfo width .t1] [winfo height .t1] [wm geometry .t2]
} {300 80 300x80+0+0}
test macEmbed-3.5 {EmbeddedEventProc procedure, map requests} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -162,9 +144,7 @@ test macEmbed-3.5 {EmbeddedEventProc procedure, map requests} {macOnly} {
set x
} {mapped}
test macEmbed-3.6 {EmbeddedEventProc procedure, destroy events} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -178,9 +158,7 @@ test macEmbed-3.6 {EmbeddedEventProc procedure, destroy events} {macOnly} {
} {dead 0}
test macEmbed-4.1 {EmbedStructureProc procedure, configure events} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -191,9 +169,7 @@ test macEmbed-4.1 {EmbedStructureProc procedure, configure events} {macOnly} {
winfo geometry .t1
} {180x100+0+0}
test macEmbed-4.2 {EmbedStructureProc procedure, destroy events} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -208,9 +184,7 @@ test macEmbed-4.2 {EmbedStructureProc procedure, destroy events} {macOnly} {
test unixEmbed-5.1 {TkpClaimFocus procedure} {macOnly tempNotMac} {
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
@@ -232,9 +206,7 @@ test unixEmbed-5.1 {TkpClaimFocus procedure} {macOnly tempNotMac} {
catch {interp delete child}
test macEmbed-6.1 {EmbedWindowDeleted procedure, check parentPtr} {macOnly} {
- 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
@@ -249,9 +221,7 @@ test macEmbed-6.1 {EmbedWindowDeleted procedure, check parentPtr} {macOnly} {
set x
} {{{XXX .f4 {} {}} {XXX .f3 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f4 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}}} {}}
test macEmbed-6.2 {EmbedWindowDeleted procedure, check embeddedPtr} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -264,9 +234,7 @@ test macEmbed-6.2 {EmbedWindowDeleted procedure, check embeddedPtr} {macOnly} {
} {{{XXX .f1 XXX .t1}} {}}
test macEmbed-7.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOnly} {
- 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
@@ -276,9 +244,7 @@ test macEmbed-7.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOn
wm geometry .t1
} {150x80+0+0}
test macEmbed-7.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOnly} {
- 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
@@ -290,9 +256,7 @@ test macEmbed-7.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOn
-foreach w [winfo child .] {
- catch {destroy $w}
-}
+deleteWindows
# cleanup
::tcltest::cleanupTests