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

Subversion Repositories or1k

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

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] Labeledframe 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
#
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: labeledframe.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 Labeledframe-1.$c {Labeledframe construction} {
33
    iwidgets::Labeledframe .lf
34
    set cs [.lf childsite]
35
    .lf configure -background yellow
36
    pack [radiobutton $cs.w1 -anchor w -text "Button1"] -anchor w -fill x
37
    pack [radiobutton $cs.w2 -anchor w -text "Button2"] -anchor w -fill x
38
    pack [radiobutton $cs.w3 -anchor w -text "Button3"] -anchor w -fill x
39
    pack [radiobutton $cs.w4 -anchor w -text "Button4"] -anchor w -fill x
40
    pack [radiobutton $cs.w5 -anchor w -text "Button5"] -anchor w -fill x
41
    pack [radiobutton $cs.w6 -anchor w -text "Button6"] -anchor w -fill x
42
    pack [radiobutton $cs.w7 -anchor w -text "Button7"] -anchor w -fill x
43
    pack [radiobutton $cs.w8 -anchor w -text "Button8"] -anchor w -fill x
44
 
45
    pack .lf -fill both -expand yes
46
    update
47
} {}
48
 
49
incr c
50
 
51
#
52
# Option tests which are successful.
53
#
54
test Labeledframe-2.$o {configuration option} {
55
    llength [.lf configure]
56
} {15}
57
 
58
incr o
59
 
60
foreach test {
61
    {-labeltext "Label" "Label"}
62
    {-labelpos nw nw}
63
    {-labelpos n n}
64
    {-labelpos ne ne}
65
    {-labelpos en en}
66
    {-labelpos e e}
67
    {-labelpos es es}
68
    {-labelpos sw sw}
69
    {-labelpos s s}
70
    {-labelpos se se}
71
    {-labelpos wn wn}
72
    {-labelpos w w}
73
    {-labelpos ws ws}
74
    {-labelfont 6x13 6x13}
75
    {-labelpos nw nw}
76
    {-labelpos n n}
77
    {-labelpos ne ne}
78
    {-labelpos en en}
79
    {-labelpos e e}
80
    {-labelpos es es}
81
    {-labelpos sw sw}
82
    {-labelpos s s}
83
    {-labelpos se se}
84
    {-labelpos wn wn}
85
    {-labelpos w w}
86
    {-labelpos ws ws}
87
    {-relief groove groove}
88
    {-relief sunken sunken}
89
    {-relief raised raised}
90
    {-relief ridge  ridge}
91
    {-relief flat   flat}
92
    {-borderwidth 2 2}
93
    {-borderwidth 4 4}
94
    {-borderwidth 6 6}
95
    {-borderwidth 8 8}
96
    {-borderwidth 10 10}
97
    {-ipadx 20 20}
98
    {-ipady 20 20}
99
    {-ipadx 10 10}
100
    {-ipady 10 10}
101
    {-ipadx 0 0}
102
    {-ipady 0 0}
103
    } {
104
        set option [lindex $test 0]
105
        test Labeledframe-1.$o "configuration options, $option" {
106
            .lf configure $option [lindex $test 1]
107
            lindex [.lf configure $option] 4
108
        } [lindex $test 2]
109
        update
110
        incr o
111
    }
112
 
113
#
114
# Method tests which are successful.
115
#
116
test Labeledframe-3.$m {object method, childsite} {
117
    list [catch {.lf childsite} msg] $msg
118
} [list 0 .lf.childsite]
119
 
120
incr m
121
 
122
test Labeledframe-3.$m {object static method, initTable} {
123
 
124
} {}
125
 
126
incr m
127
 
128
#
129
# Method tests which fail and produce errors
130
#
131
test Labeledframe-3.$m {initTable static method} {
132
    button .b
133
 
134
} {.b}
135
 
136
incr m
137
 
138
test Labeledframe-1.$c {Labeledframe destruction} {
139
    destroy .b
140
    destroy .lf
141
    update
142
} {}
143
 
144
incr c
145
 
146
test Labeledframe-1.$c {Labeledframe construction} {
147
    iwidgets::labeledframe .lf -labeltext "ListBox" -labelpos s
148
    set cs [.lf childsite]
149
    .lf configure -background yellow
150
    pack [radiobutton $cs.w1 -anchor w -text "Button1"] -anchor w -fill x
151
    pack [radiobutton $cs.w2 -anchor w -text "Button2"] -anchor w -fill x
152
    pack [radiobutton $cs.w3 -anchor w -text "Button3"] -anchor w -fill x
153
    pack [radiobutton $cs.w4 -anchor w -text "Button4"] -anchor w -fill x
154
    pack [radiobutton $cs.w5 -anchor w -text "Button5"] -anchor w -fill x
155
    pack [radiobutton $cs.w6 -anchor w -text "Button6"] -anchor w -fill x
156
    pack [radiobutton $cs.w7 -anchor w -text "Button7"] -anchor w -fill x
157
    pack [radiobutton $cs.w8 -anchor w -text "Button8"] -anchor w -fill x
158
    pack .lf -fill both -expand yes
159
    update
160
} {}
161
 
162
incr c
163
 
164
test Labeledframe-1.$c {Labeledframe destruction} {
165
    destroy .lf
166
    update
167
} {}
168
 
169
incr c
170
 
171
test Labeledframe-1.$c {Labeledframe construction} {
172
    iwidgets::labeledframe .lf
173
    pack .lf
174
    destroy .lf
175
    update
176
} {}
177
 
178
 

powered by: WebSVN 2.1.0

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