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/] [feedback.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] feedback 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: feedback.test
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 Feedback-1.$c {Feedback construction} {
33
    iwidgets::Feedback .f
34
    pack .f -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 Feedback-2.$o {configuration option} {
44
    llength [.f configure]
45
} {21}
46
 
47
incr o
48
 
49
foreach test {
50
    {-background #d9d9d9 #d9d9d9}
51
    {-cursor gumby gumby}
52
    {-foreground Black Black}
53
    {-labelmargin 5 5}
54
    {-labeltext Label Label}
55
    {-labelpos n n}
56
    {-labelpos ne ne}
57
    {-labelpos e e}
58
    {-labelpos se se}
59
    {-labelpos s s}
60
    {-labelpos sw sw}
61
    {-labelpos w w}
62
    {-labelpos nw nw}
63
    {-barcolor red red}
64
    {-steps 50 50}
65
    {-barheight 20 20}} {
66
        set option [lindex $test 0]
67
        test Feedback-2.$o "configuration options, $option" {
68
            .f configure $option [lindex $test 1]
69
            lindex [.f configure $option] 4
70
        } [lindex $test 2]
71
        update
72
        incr o
73
}
74
 
75
#
76
# Option tests which fail and produce errors.
77
#
78
#foreach test {
79
#  {} {
80
#       set option [lindex $test 0]
81
#        test Feedback-2.$o "configuration options, $option" {
82
#           list [catch {.f configure $option [lindex $test 1]} msg] $msg
83
#       } [list 1 [lindex $test 2]]
84
#       incr o
85
#}
86
 
87
#
88
# Method tests which are successful.
89
#
90
foreach test {
91
    {{.f step} {}}} {
92
        set method [lindex [lindex $test 0] 1]
93
        test Feedback-3.$m "object methods, $method" {
94
            list [catch {eval [lindex $test 0]} msg] $msg
95
        } [list 0 [lindex $test 1]]
96
        update
97
        incr m
98
}
99
 
100
#
101
# Conclusion of construction/destruction tests
102
#
103
test Feedback-1.$c {Feedback destruction} {
104
    destroy .f
105
    update
106
} {}
107
 
108
incr c
109
 
110
test Feedback-1.$c {Feedback construction} {
111
    iwidgets::feedback .f -labeltext "Label" \
112
            -labelpos n -labelmargin 5
113
    pack .f -padx 10 -pady 10 -fill both -expand yes
114
    update
115
} {}
116
 
117
incr c
118
 
119
test Feedback-1.$c {Feedback destruction} {
120
    destroy .f
121
    update
122
} {}
123
 
124
incr c
125
 
126
test Feedback-1.$c {Feedback destruction} {
127
    iwidgets::feedback .f
128
    pack .f
129
    destroy .f
130
    update
131
} {}
132
 

powered by: WebSVN 2.1.0

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