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/] [dialog.test] - Blame information for rev 579

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] Dialog 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: dialog.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 Dialog-1.$c {Dialog construction} {
34
    iwidgets::Dialog .dlg
35
 
36
    listbox [.dlg childsite].lb -relief sunken
37
    pack [.dlg childsite].lb -fill both -expand yes
38
 
39
    .dlg activate
40
} {}
41
 
42
incr c
43
 
44
#
45
# Option tests which are successful.
46
#
47
test Dialog-2.$o {configuration option} {
48
    llength [.dlg configure]
49
} {17}
50
 
51
incr o
52
 
53
foreach test {
54
    {-background #d9d9d9 #d9d9d9}
55
    {-width 400 400}
56
    {-height 400 400}
57
    {-buttonboxpadx 10 10}
58
    {-buttonboxpady 10 10}
59
    {-buttonboxpos n n}
60
    {-buttonboxpos e e}
61
    {-buttonboxpos w w}
62
    {-buttonboxpos s s}
63
    {-cursor gumby gumby}
64
    {-modality global global}
65
    {-modality application application}
66
    {-modality none none}
67
    {-padx 15 15}
68
    {-pady 15 15}
69
    {-separator off off}
70
    {-thickness 5 5}
71
    {-width 0 0}
72
    {-height 0 0}
73
    {-separator on on}
74
    {-title Dialog Dialog}} {
75
        set option [lindex $test 0]
76
        test Dialog-2.$o "configuration options, $option" {
77
            .dlg configure $option [lindex $test 1]
78
            lindex [.dlg configure $option] 4
79
        } [lindex $test 2]
80
        update
81
        incr o
82
}
83
 
84
#
85
# Method tests which are successful.
86
#
87
foreach test {
88
    {{.dlg childsite} {.dlg.shellchildsite.dschildsite}}
89
    {{.dlg hide Help} {}}
90
    {{.dlg hide Cancel} {}}
91
    {{.dlg default Apply} {}}
92
    {{.dlg buttonconfigure Help -state disabled} {}}
93
    {{.dlg show Cancel} {}}
94
    {{.dlg deactivate} {}}} {
95
        set method [lindex [lindex $test 0] 1]
96
        test Dialog-3.$m "object methods, $method" {
97
            list [catch {eval [lindex $test 0]} msg] $msg
98
        } [list 0 [lindex $test 1]]
99
        update
100
        incr m
101
}
102
 
103
#
104
# Conclusion of constrcution/destruction tests
105
#
106
test Dialog-1.$c {Dialog destruction} {
107
    destroy .dlg
108
    update
109
} {}
110
 
111
incr c
112
 
113
test Dialog-1.$c {Dialog construction} {
114
    iwidgets::Dialog .dlg
115
    update
116
} {}
117
 
118
incr c
119
 
120
test Dialog-1.$c {Dialog destruction} {
121
    destroy .dlg
122
    update
123
} {}
124
 
125
incr c
126
 
127
test Dialog-1.$c {Dialog destruction} {
128
    iwidgets::dialog .dlg
129
    destroy .dlg
130
    update
131
} {}

powered by: WebSVN 2.1.0

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