OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [tags/] [start/] [insight/] [itcl/] [iwidgets3.0.0/] [tests/] [messagedialog.test] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# This file is a Tcl script to test out [incr Widgets] Messagedialog class.
2
# It is organized in the standard fashion for Tcl tests with the following
3
# notation for test case labels:
4
#
5
#   1.x - Construction/Destruction tests
6
#   2.x - Configuration option tests
7
#   3.x - Method tests
8
#   4.x - Other tests
9
#
10
# Copyright (c) 1995 DSC Technologies Corporation
11
#
12
# See the file "license.terms" for information on usage and redistribution
13
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14
#
15
# @(#) $Id: messagedialog.test,v 1.1.1.1 2002-01-16 10:24:51 markom Exp $
16
 
17
package require Iwidgets 3.0
18
 
19
if {[string compare test [info procs test]] == 1} {
20
    source defs
21
}
22
 
23
wm geometry . {}
24
raise .
25
 
26
set c 1
27
set o 1
28
set m 1
29
 
30
#
31
# Initial construction test
32
#
33
test Messagedialog-1.$c {Messagedialog construction} {
34
    iwidgets::Messagedialog .md -text "Are you sure ?" -bitmap questhead
35
    image create bitmap flagup -file $tk_library/demos/images/flagup.bmp
36
    .md activate
37
} {}
38
 
39
incr c
40
 
41
#
42
# Option tests which are successful.
43
#
44
test Messagedialog-2.$o {configuration option} {
45
    llength [.md configure]
46
} {24}
47
 
48
incr o
49
 
50
foreach test {
51
    {-background #d9d9d9 #d9d9d9}
52
    {-buttonboxpos n n}
53
    {-buttonboxpadx 10 10}
54
    {-buttonboxpos e e}
55
    {-buttonboxpos w w}
56
    {-buttonboxpady 10 10}
57
    {-buttonboxpos s s}
58
    {-imagepos n n}
59
    {-bitmap warning warning}
60
    {-imagepos e e}
61
    {-imagepos s s}
62
    {-cursor gumby gumby}
63
    {-image flagup flagup}
64
    {-imagepos w w}
65
    {-font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*}
66
    {-foreground Black Black}
67
    {-modality global global}
68
    {-modality application application}
69
    {-modality none none}
70
    {-padx 15 15}
71
    {-pady 15 15}
72
    {-textpadx 15 15}
73
    {-textpady 15 15}
74
    {-separator off off}
75
    {-thickness 4 4}
76
    {-separator on on}
77
    {-image {} {}}
78
    {-title Messagedialog Messagedialog}} {
79
        set option [lindex $test 0]
80
        test Messagedialog-2.$o "configuration options, $option" {
81
            .md configure $option [lindex $test 1]
82
            lindex [.md configure $option] 4
83
        } [lindex $test 2]
84
        update
85
        incr o
86
}
87
 
88
#
89
# Option tests which fail and produce errors.
90
#
91
foreach test {
92
  {-imagepos bogus {bad imagepos option "bogus": should be n, e, s, or w}}} {
93
        set option [lindex $test 0]
94
        test Messagedialog-2.$o "configuration options, $option" {
95
            list [catch {.md configure $option [lindex $test 1]} msg] $msg
96
        } [list 1 [lindex $test 2]]
97
        incr o
98
}
99
 
100
#
101
# Method tests which are successful.
102
#
103
foreach test {
104
    {{.md childsite} {.md.shellchildsite.dschildsite}}
105
    {{.md hide Help} {}}
106
    {{.md hide Cancel} {}}
107
    {{.md default Apply} {}}
108
    {{.md show Cancel} {}}
109
    {{.md deactivate} {}}} {
110
        set method [lindex [lindex $test 0] 1]
111
        test Messagedialog-3.$m "object methods, $method" {
112
            list [catch {eval [lindex $test 0]} msg] $msg
113
        } [list 0 [lindex $test 1]]
114
        update
115
        incr m
116
}
117
 
118
#
119
# Conclusion of constrcution/destruction tests
120
#
121
test Messagedialog-1.$c {Messagedialog destruction} {
122
    destroy .md
123
    update
124
} {}
125
 
126
incr c
127
 
128
test Messagedialog-1.$c {Messagedialog construction} {
129
    iwidgets::Messagedialog .md
130
    update
131
} {}
132
 
133
incr c
134
 
135
test Messagedialog-1.$c {Messagedialog destruction} {
136
    destroy .md
137
    image delete flagup
138
    update
139
} {}
140
 
141
incr c
142
 
143
test Messagedialog-1.$c {Messagedialog construction} {
144
    iwidgets::messagedialog .md
145
    destroy .md
146
    update
147
} {}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.