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/] [promptdialog.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] Promptdialog 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
#   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: promptdialog.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 Promptdialog-1.$c {Promptdialog construction} {
34
    iwidgets::Promptdialog .pd
35
    .pd activate
36
} {}
37
 
38
incr c
39
 
40
#
41
# Option tests which are successful.
42
#
43
test Promptdialog-2.$o {configuration option} {
44
    llength [.pd configure]
45
} {38}
46
 
47
incr o
48
 
49
foreach test {
50
    {-background #d9d9d9 #d9d9d9}
51
    {-buttonboxpos n n}
52
    {-buttonboxpadx 10 10}
53
    {-buttonboxpos e e}
54
    {-buttonboxpos w w}
55
    {-buttonboxpady 10 10}
56
    {-buttonboxpos s s}
57
    {-cursor gumby gumby}
58
    {-exportselection 1 1}
59
    {-modality global global}
60
    {-modality application application}
61
    {-modality none none}
62
    {-padx 15 15}
63
    {-pady 15 15}
64
    {-separator off off}
65
    {-thickness 5 5}
66
    {-separator on on}
67
    {-title "Prompt Dialog" "Prompt Dialog"}
68
    {-foreground Black Black}
69
    {-textbackground GhostWhite GhostWhite}
70
    {-insertbackground Black Black}
71
    {-insertborderwidth 1 1}
72
    {-insertborderwidth 0 0}
73
    {-insertofftime 400 400}
74
    {-insertontime 700 700}
75
    {-insertwidth 3 3}
76
    {-labelpos nw nw}
77
    {-labelpos n n}
78
    {-labelpos ne ne}
79
    {-labelpos en en}
80
    {-labelpos e e}
81
    {-labelpos es es}
82
    {-labelpos sw sw}
83
    {-labelpos s s}
84
    {-labelpos se se}
85
    {-labelpos wn wn}
86
    {-labelpos w w}
87
    {-labelpos ws ws}
88
    {-labeltext Label Label}
89
    {-relief sunken sunken}
90
    {-textbackground GhostWhite GhostWhite}
91
    {-validate numeric numeric}
92
    {-validate alphabetic alphabetic}
93
    {-validate alphanumeric alphanumeric}} {
94
        set option [lindex $test 0]
95
        test Promptdialog-2.$o "configuration options, $option" {
96
            .pd configure $option [lindex $test 1]
97
            lindex [.pd configure $option] 4
98
        } [lindex $test 2]
99
        update
100
        incr o
101
}
102
 
103
#
104
# Method tests which are successful.
105
#
106
foreach test {
107
    {{.pd childsite} {.pd.shellchildsite.dschildsite}}
108
    {{.pd insert end "Test String"} {}}
109
    {{.pd get} {Test String}}
110
    {{.pd delete 0 end} {}}
111
    {{.pd insert end "Another Test"} {}}
112
    {{.pd icursor end} {}}
113
    {{.pd index end} 12}
114
    {{.pd selection from 0} {}}
115
    {{.pd selection to end} {}}
116
    {{.pd xview 3} {}}
117
    {{.pd clear} {}}
118
    {{.pd hide Help} {}}
119
    {{.pd hide Cancel} {}}
120
    {{.pd default Apply} {}}
121
    {{.pd show Cancel} {}}
122
    {{.pd deactivate} {}}} {
123
        set method [lindex [lindex $test 0] 1]
124
        test Promptdialog-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 Promptdialog-1.$c {Promptdialog destruction} {
135
    destroy .pd
136
    update
137
} {}
138
 
139
incr c
140
 
141
test Promptdialog-1.$c {Promptdialog construction} {
142
    iwidgets::promptdialog .pd
143
    update
144
} {}
145
 
146
incr c
147
 
148
test Promptdialog-1.$c {Promptdialog destruction} {
149
    destroy .pd
150
    update
151
} {}
152
 
153
incr c
154
 
155
test Promptdialog-1.$c {Promptdialog destruction} {
156
    iwidgets::promptdialog .pd
157
    destroy .pd
158
    update
159
} {}

powered by: WebSVN 2.1.0

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