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/] [radiobox.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] Radiobox 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: radiobox.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 Radiobox-1.$c {Radiobox construction} {
33
    iwidgets::Radiobox .rb -labeltext "Radiobox"
34
    pack .rb -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 Radiobox-2.$o {configuration option} {
44
    llength [.rb configure]
45
} {18}
46
 
47
incr o
48
 
49
test Radiobox-1.$c {Radiobox add method} {
50
    .rb add foo -text Foo
51
    .rb add bar -text Bar
52
    update
53
} {}
54
 
55
incr m
56
 
57
foreach test {
58
    {-background #d9d9d9 #d9d9d9}
59
    {-borderwidth 4 4}
60
    {-borderwidth 2 2}
61
    {-cursor gumby gumby}
62
    {-foreground Green Green}
63
    {-foreground Black Black}
64
    {-labelmargin 5 5}
65
    {-labelpos w w}
66
    {-labelpos nw nw}
67
    {-labelpos n n}
68
    {-labelpos ne ne}
69
    {-labelpos e e}
70
    {-labelpos se se}
71
    {-labelpos s s}
72
    {-labelpos sw sw}
73
    {-labeltext Label Label}
74
    {-relief raised raised}
75
    {-relief sunken sunken}} {
76
        set option [lindex $test 0]
77
        test Radiobox-2.$o "configuration options, $option" {
78
            .rb configure $option [lindex $test 1]
79
            lindex [.rb configure $option] 4
80
        } [lindex $test 2]
81
        update
82
        incr o
83
}
84
 
85
#
86
# Method tests which are successful.
87
#
88
foreach test {
89
    {{.rb insert bar zoo -text Zoo} zoo}
90
    {{.rb index z*} 1}
91
    {{.rb select foo} {}}
92
    {{.rb get} foo}
93
    {{.rb delete end} {}}
94
    {{.rb deselect foo} {}}
95
    {{.rb get} {}}
96
    {{.rb index end} 1}
97
    {{.rb flash 1} {}}
98
    {{.rb buttonconfigure foo -text FOO} {}}} {
99
        set method [lindex [lindex $test 0] 1]
100
        test Radiobox-3.$m "object methods, $method" {
101
            list [catch {eval [lindex $test 0]} msg] $msg
102
        } [list 0 [lindex $test 1]]
103
        update
104
        incr m
105
}
106
 
107
#
108
# Conclusion of constrcution/destruction tests
109
#
110
test Radiobox-1.$c {Radiobox destruction} {
111
    destroy .rb
112
    update
113
} {}
114
 
115
incr c
116
 
117
test Radiobox-1.$c {Radiobox construction} {
118
    iwidgets::radiobox .rb
119
    pack .rb -padx 10 -pady 10
120
    update
121
} {}
122
 
123
incr c
124
 
125
test Radiobox-1.$c {Radiobox destruction} {
126
    destroy .rb
127
    update
128
} {}
129
 
130
incr c
131
 
132
test Radiobox-1.$c {Radiobox destruction} {
133
    iwidgets::radiobox .rb
134
    pack .rb
135
    destroy .rb
136
    update
137
} {}

powered by: WebSVN 2.1.0

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