diff options
author | aniap <aniap> | 2008-08-12 22:52:23 (GMT) |
---|---|---|
committer | aniap <aniap> | 2008-08-12 22:52:23 (GMT) |
commit | 85f8100f4ad76f94d880796df90d2eec9e0c18b6 (patch) | |
tree | ef814f04a661fa49bddee4fb3445c3996cf624a2 /tests/embed.test | |
parent | 26fe6e9cc8bf16a97f6436d5ffdb9ddf47b8d42b (diff) | |
download | tk-85f8100f4ad76f94d880796df90d2eec9e0c18b6.zip tk-85f8100f4ad76f94d880796df90d2eec9e0c18b6.tar.gz tk-85f8100f4ad76f94d880796df90d2eec9e0c18b6.tar.bz2 |
Update to tcltest2
Diffstat (limited to 'tests/embed.test')
-rw-r--r-- | tests/embed.test | 98 |
1 files changed, 58 insertions, 40 deletions
diff --git a/tests/embed.test b/tests/embed.test index 6cf4854..db486f0 100644 --- a/tests/embed.test +++ b/tests/embed.test @@ -4,69 +4,87 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: embed.test,v 1.4 2005/02/15 03:22:10 chengyemao Exp $ +# RCS: @(#) $Id: embed.test,v 1.5 2008/08/12 22:52:23 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands -global tcl_platform -test embed-1.1 {TkpUseWindow procedure, bad window identifier} { +test embed-1.1 {TkpUseWindow procedure, bad window identifier} -setup { deleteWindows - list [catch {toplevel .t -use xyz} msg] $msg -} {1 {expected integer but got "xyz"}} +} -body { + toplevel .t -use xyz +} -cleanup { + deleteWindows +} -returnCodes error -result {expected integer but got "xyz"} -test embed-1.2 {CreateFrame procedure, bad window identifier} { +test embed-1.2 {CreateFrame procedure, bad window identifier} -setup { + deleteWindows +} -body { + toplevel .t -container xyz +} -cleanup { deleteWindows - list [catch {toplevel .t -container xyz} msg] $msg -} {1 {expected boolean value but got "xyz"}} +} -returnCodes error -result {expected boolean value but got "xyz"} -test embed-1.3 {CreateFrame procedure, both -use and - -container is invalid } { +test embed-1.3 {CreateFrame procedure, both -use and -container is invalid} -setup { deleteWindows +} -body { toplevel .container -container 1 - list [catch {toplevel .t -use [winfo id .container] \ - -container 1} msg] $msg -} {1 {A window cannot have both the -use and the -container option set.}} - -if {$tcl_platform(platform) == "windows"} { - -# testing window embedding for Windows platform + toplevel .t -use [winfo id .container] -container 1 +} -cleanup { + deleteWindows +} -returnCodes error -result {A window cannot have both the -use and the -container option set.} -test embed-1.4 {TkpUseWindow procedure, -container must be set} { +# testing window embedding for win platforms +test embed-1.4 {TkpUseWindow procedure, -container must be set} -constraints { + win +} -setup { deleteWindows +} -body { toplevel .container - list [catch {toplevel .embd -use [winfo id .container]} err] $err -} {1 {the window to use is not a Tk container}} - -test embed-1.5 {TkpUseWindow procedure, -container must be set} { + toplevel .embd -use [winfo id .container] +} -cleanup { deleteWindows +} -returnCodes error -result {the window to use is not a Tk container} +# testing window embedding for win platforms +test embed-1.5 {TkpUseWindow procedure, -container must be set} -constraints { + win +} -setup { + deleteWindows +} -body { frame .container - list [catch {toplevel .embd -use [winfo id .container]} err] $err -} {1 {the window to use is not a Tk container}} - -} else { - -# testing window embedding for other platforms + toplevel .embd -use [winfo id .container] +} -cleanup { + deleteWindows +} -returnCodes error -result {the window to use is not a Tk container} -test embed-1.4 {TkpUseWindow procedure, -container must be set} { +# testing window embedding for other than win platforms +test embed-1.5 {TkpUseWindow procedure, -container must be set} -constraints { + nonwin +} -setup { deleteWindows +} -body { toplevel .container - list [catch {toplevel .embd -use [winfo id .container]} err] $err -} {1 {window ".container" doesn't have -container option set}} - -test embed-1.5 {TkpUseWindow procedure, -container must be set} { + toplevel .embd -use [winfo id .container] +} -cleanup { + deleteWindows +} -returnCodes error -result {window ".container" doesn't have -container option set} +# testing window embedding for other than win platforms +test embed-1.6 {TkpUseWindow procedure, -container must be set} -constraints { + nonwin +} -setup { deleteWindows +} -body { frame .container - list [catch {toplevel .embd -use [winfo id .container]} err] $err -} {1 {window ".container" doesn't have -container option set}} - -} + toplevel .embd -use [winfo id .container] +} -cleanup { + deleteWindows +} -returnCodes error -result {window ".container" doesn't have -container option set} -# FIXME: test cases common to unixEmbed.test and macEmbed.test should -# be moved here. cleanupTests return + |