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/] [extfileselectiondialog.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] Extfileselectiondialog
2
# class.  It is organized in the standard fashion for Tcl tests with the
3
# following 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: extfileselectiondialog.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 Extfileselectiondialog-1.$c {Extfileselectiondialog construction} {
34
    iwidgets::Extfileselectiondialog .fsd
35
    .fsd activate
36
} {}
37
 
38
incr c
39
 
40
#
41
# Option tests which are successful.
42
#
43
test Extfileselectiondialog-2.$o {configuration option} {
44
    llength [.fsd configure]
45
} {51}
46
 
47
incr o
48
 
49
foreach test {
50
    {-activebackground #ececec #ececec}
51
    {-borderwidth 2 2}
52
    {-childsitepos n n}
53
    {-childsitepos s s}
54
    {-childsitepos e e}
55
    {-childsitepos w w}
56
    {-childsitepos top top}
57
    {-childsitepos bottom bottom}
58
    {-cursor gumby gumby}
59
    {-directory {..} {..}}
60
    {-textbackground GhostWhite GhostWhite}
61
    {-foreground Black Black}
62
    {-insertbackground Black Black}
63
    {-insertborderwidth 1 1}
64
    {-insertofftime 200 200}
65
    {-insertontime  500 500}
66
    {-insertwidth 3 3}
67
    {-dirslabel "Dirs Label" "Dirs Label"}
68
    {-dirson no no}
69
    {-dirson yes yes}
70
    {-fileslabel "Files Label" "Files Label"}
71
    {-fileson no no}
72
    {-directory ../tests ../tests}
73
    {-mask *.* *.*}
74
    {-nomatchstring {No Files} {No Files}}
75
    {-fileson yes yes}
76
    {-filetype any any}
77
    {-filetype directory directory}
78
    {-filetype regular regular}
79
    {-filterlabel "Filter Label" "Filter Label"}
80
    {-filteron no no}
81
    {-filteron yes yes}
82
    {-selectbackground #c3c3c3 #c3c3c3}
83
    {-selectionlabel "Selection Label" "Selection Label"}
84
    {-selectionon no no}
85
    {-selectionon yes yes}
86
    {-textfont -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
87
    {-background #d9d9d9 #d9d9d9}
88
    {-buttonboxpos n n}
89
    {-buttonboxpos e e}
90
    {-buttonboxpos w w}
91
    {-buttonboxpos s s}
92
    {-cursor gumby gumby}
93
    {-modality global global}
94
    {-modality application application}
95
    {-modality none none}
96
    {-padx 15 15}
97
    {-pady 15 15}
98
    {-separator off off}
99
    {-thickness 4 4}
100
    {-separator on on}
101
    {-title Extfileselectiondialog Extfileselectiondialog}} {
102
        set option [lindex $test 0]
103
        test Extfileselectiondialog-2.$o "configuration options, $option" {
104
            .fsd configure $option [lindex $test 1]
105
            lindex [.fsd configure $option] 4
106
        } [lindex $test 2]
107
        update
108
        incr o
109
}
110
 
111
#
112
# Option tests which fail and produce errors.
113
#
114
foreach test {
115
  {-directory bogus {bad directory option "bogus": directory does not exist}}
116
  {-filetype bogus {bad filetype option "bogus": should be regular, directory, or any}}} {
117
        set option [lindex $test 0]
118
        test FileSelectionBox-2.$o "configuration options, $option" {
119
            list [catch {.fsd configure $option [lindex $test 1]} msg] $msg
120
        } [list 1 [lindex $test 2]]
121
        incr o
122
}
123
 
124
#
125
# Method tests which are successful.
126
#
127
foreach test {
128
    {{.fsd childsite} {.fsd.shellchildsite.dschildsite.fsb.fsbchildsite}}
129
    {{.fsd hide Help} {}}
130
    {{.fsd hide Cancel} {}}
131
    {{.fsd default Apply} {}}
132
    {{.fsd show Cancel} {}}
133
    {{.fsd deactivate} {}}} {
134
        set method [lindex [lindex $test 0] 1]
135
        test Extfileselectiondialog-3.$m "object methods, $method" {
136
            list [catch {eval [lindex $test 0]} msg] $msg
137
        } [list 0 [lindex $test 1]]
138
        update
139
        incr m
140
}
141
 
142
#
143
# Conclusion of constrcution/destruction tests
144
#
145
test Extfileselectiondialog-1.$c {Extfileselectiondialog destruction} {
146
    destroy .fsd
147
    update
148
} {}
149
 
150
incr c
151
 
152
test Extfileselectiondialog-1.$c {Extfileselectiondialog construction} {
153
    iwidgets::extfileselectiondialog .fsd
154
    update
155
} {}
156
 
157
incr c
158
 
159
test Extfileselectiondialog-1.$c {Extfileselectiondialog destruction} {
160
    destroy .fsd
161
    update
162
} {}
163
 
164
incr c
165
 
166
test Extfileselectiondialog-1.$c {Extfileselectiondialog destruction} {
167
    iwidgets::extfileselectiondialog .fsd
168
    destroy .fsd
169
    update
170
} {}
171
 
172
#
173
# Childsite tests
174
#
175
incr o
176
 
177
test Extfileselectiondialog-1.$o {Extfileselectiondialog -childsitepos} {
178
    iwidgets::extfileselectiondialog .fsd
179
    .fsd activate
180
    update
181
    label [.fsd childsite].lb -background red -text CS
182
    pack [.fsd childsite].lb -fill both -expand yes
183
    update
184
 
185
    .fsd configure -childsitepos n
186
    update
187
    .fsd configure -childsitepos s
188
    update
189
    .fsd configure -childsitepos e
190
    update
191
    .fsd configure -childsitepos w
192
    update
193
    .fsd configure -childsitepos top
194
    update
195
    .fsd configure -childsitepos bottom
196
    update
197
    .fsd deactivate
198
    update
199
    destroy .fsd
200
} {}

powered by: WebSVN 2.1.0

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