File: embed.test

package info (click to toggle)
saods9 3.0.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 86,868 kB
  • ctags: 82,021
  • sloc: ansic: 663,637; tcl: 111,403; cpp: 52,727; sh: 27,784; makefile: 6,177; asm: 3,355; lex: 2,890; ada: 1,637; pascal: 1,621; xml: 1,221; yacc: 883; f90: 84; perl: 82; python: 33; fortran: 17; ruby: 13; sed: 12; php: 11
file content (51 lines) | stat: -rw-r--r-- 1,796 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This file is a Tcl script to test out embedded Windows.
#
# Copyright (c) 1996-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id: embed.test,v 1.1.1.1 2004/04/02 22:35:05 joye 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 embed-1.1 {TkpUseWindow procedure, bad window identifier} {
    deleteWindows
    list [catch {toplevel .t -use xyz} msg] $msg
} {1 {expected integer but got "xyz"}}

test embed-1.2 {CreateFrame procedure, bad window identifier} {
    deleteWindows
    list [catch {toplevel .t -container xyz} msg] $msg
} {1 {expected boolean value but got "xyz"}}

test embed-1.3 {CreateFrame procedure, both -use and
        -container is invalid } {
    deleteWindows
    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.}}

test embed-1.4 {TkpUseWindow procedure, -container must be set} {
    deleteWindows
    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} {
    deleteWindows
    frame .container
    list [catch {toplevel .embd -use [winfo id .container]} err] $err
} {1 {window ".container" doesn't have -container option set}}


# FIXME: test cases common to unixEmbed.test and macEmbed.test should
# be moved here.

tcltest::cleanupTests
return