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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [iwidgets3.0.0/] [tests/] [extfileselectionbox.test] - Blame information for rev 578

Go to most recent revision | 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] Extfileselectionbox
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
#
9
# Copyright (c) 1995 DSC Technologies Corporation
10
#
11
# See the file "license.terms" for information on usage and redistribution
12
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
#
14
# @(#) $Id: extfileselectionbox.test,v 1.1.1.1 2002-01-16 10:24:51 markom Exp $
15
 
16
package require Iwidgets 3.0
17
 
18
if {[string compare test [info procs test]] == 1} {
19
    source defs
20
}
21
 
22
wm geometry . {}
23
raise .
24
 
25
set c 1
26
set o 1
27
set m 1
28
 
29
#
30
# Initial construction test
31
#
32
test Extfileselectionbox-1.$c {Extfileselectionbox construction} {
33
    iwidgets::Extfileselectionbox .fsb
34
    pack .fsb -padx 10 -pady 10 -fill both -expand yes
35
    update
36
} {}
37
 
38
incr c
39
 
40
#
41
# Option tests which are successful.
42
#
43
test Extfileselectionbox-2.$o {configuration option} {
44
    llength [.fsb configure]
45
} {47}
46
 
47
incr o
48
 
49
foreach test {
50
    {-activebackground #ececec #ececec}
51
    {-activerelief raised raised}
52
    {-background #d9d9d9 #d9d9d9}
53
    {-borderwidth 2 2}
54
    {-textbackground GhostWhite GhostWhite}
55
    {-childsitepos n n}
56
    {-childsitepos s s}
57
    {-childsitepos e e}
58
    {-childsitepos w w}
59
    {-childsitepos top top}
60
    {-childsitepos bottom bottom}
61
    {-cursor gumby gumby}
62
    {-directory {..} {..}}
63
    {-foreground Black Black}
64
    {-highlightcolor black black}
65
    {-highlightthickness 2 2}
66
    {-insertbackground Black Black}
67
    {-insertborderwidth 1 1}
68
    {-insertofftime 300 300}
69
    {-insertontime  600 600}
70
    {-insertwidth 3 3}
71
    {-dirslabel "Dirs Label" "Dirs Label"}
72
    {-dirson no no}
73
    {-dirson yes yes}
74
    {-fileslabel "Files Label" "Files Label"}
75
    {-fileson no no}
76
    {-fileson yes yes}
77
    {-filetype any any}
78
    {-filetype directory directory}
79
    {-filetype regular regular}
80
    {-filterlabel "Filter Label" "Filter Label"}
81
    {-filteron no no}
82
    {-filteron yes yes}
83
    {-directory ../tests ../tests}
84
    {-mask *.* *.*}
85
    {-nomatchstring {No Files} {No Files}}
86
    {-labelfont -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
87
    {-selectbackground #e6ceb1 #e6ceb1}
88
    {-selectborderwidth 1 1}
89
    {-selectionlabel "Selection Label" "Selection Label"}
90
    {-selectionon no no}
91
    {-selectionon yes yes}
92
    {-textfont -*-courier-medium-r-normal--*-120-* -*-courier-medium-r-normal--*-120-*}
93
    {-troughcolor #c3c3c3 #c3c3c3}
94
    {-width 400 400}
95
    {-height 375 375}} {
96
        set option [lindex $test 0]
97
        test Extfileselectionbox-2.$o "configuration options, $option" {
98
            .fsb configure $option [lindex $test 1]
99
            lindex [.fsb configure $option] 4
100
        } [lindex $test 2]
101
        update
102
        incr o
103
}
104
#
105
# Option tests which fail and produce errors.
106
#
107
foreach test {
108
  {-directory bogus {bad directory option "bogus": directory does not exist}}
109
  {-filetype bogus {bad filetype option "bogus": should be regular, directory, or any}}} {
110
        set option [lindex $test 0]
111
        test Extfileselectionbox-2.$o "configuration options, $option" {
112
            list [catch {.fsb configure $option [lindex $test 1]} msg] $msg
113
        } [list 1 [lindex $test 2]]
114
        incr o
115
}
116
 
117
#
118
# Method tests which are successful.
119
#
120
foreach test {
121
    {{.fsb childsite} {.fsb.fsbchildsite}}
122
    {{.fsb get} {}}} {
123
        set method [lindex [lindex $test 0] 1]
124
        test Extfileselectionbox-3.$m "object methods, $method" {
125
            list [catch {eval [lindex $test 0]} msg] $msg
126
        } [list 0 [lindex $test 1]]
127
        update
128
        incr m
129
}
130
 
131
#
132
# Conclusion of constrcution/destruction tests
133
#
134
test Extfileselectionbox-1.$c {Extfileselectionbox destruction} {
135
    destroy .fsb
136
    update
137
} {}
138
 
139
 
140
incr c
141
 
142
test Extfileselectionbox-1.$c {Extfileselectionbox construction} {
143
    iwidgets::extfileselectionbox .fsb
144
    pack .fsb -padx 10 -pady 10 -fill both -expand yes
145
    update
146
} {}
147
 
148
 
149
incr c
150
 
151
test Extfileselectionbox-1.$c {Extfileselectionbox destruction} {
152
    destroy .fsb
153
    update
154
} {}
155
 
156
incr c
157
 
158
 
159
test Extfileselectionbox-1.$c {Extfileselectionbox destruction} {
160
    iwidgets::extfileselectionbox .fsb
161
    pack .fsb
162
    destroy .fsb
163
    update
164
} {}
165
 
166
#
167
# Childsite tests
168
#
169
incr o
170
 
171
test Extfileselectionbox-1.$o {Extfileselectionbox -childsitepos} {
172
    iwidgets::extfileselectionbox .fsb
173
    pack .fsb
174
    update
175
    label [.fsb childsite].lb -background red -text CS
176
    pack [.fsb childsite].lb -fill both -expand yes
177
    update
178
 
179
    .fsb configure -childsitepos n
180
    update
181
    .fsb configure -childsitepos s
182
    update
183
    .fsb configure -childsitepos e
184
    update
185
    .fsb configure -childsitepos w
186
    update
187
    .fsb configure -childsitepos top
188
    update
189
    .fsb configure -childsitepos bottom
190
    update
191
    destroy .fsb
192
} {}

powered by: WebSVN 2.1.0

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