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/] [hyperhelp.html] - Blame information for rev 1765

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] Hyperhelp 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: hyperhelp.test
15
 
16
if {[string compare test [info procs test]] == 1} {
17
    source defs
18
}
19
 
20
set c 1
21
set o 1
22
set m 1
23
 
24
#
25
# Initial construction test
26
#
27
test Hyperhelp-1.$c {Hyperhelp construction} {
28
    Hyperhelp .h
29
    .h activate
30
    update
31
} {}
32
 
33
incr c
34
 
35
#
36
# Option tests which are successful.
37
#
38
test Hyperhelp-2.$o {configuration option} {
39
    llength [.h configure]
40
} {37}
41
 
42
incr o
43
 
44
foreach test [concat {
45
    {-activebackground #ececec #ececec}
46
    {-activeforeground Black Black}
47
    {-activerelief raised raised}
48
    {-background #d9d9d9 #d9d9d9}
49
    {-borderwidth 3 3}
50
    {-cursor gumby gumby}
51
    {-font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
52
       -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*}
53
    {-foreground Black Black}
54
    {-highlightcolor Black Black}
55
    {-highlightthickness 3 3}
56
    {-height 120 120}
57
    {-width 500 500}
58
    {-relief raised raised}
59
    {-relief sunken sunken}
60
    {-vscrollmode none none}
61
    {-vscrollmode static static}
62
    {-vscrollmode dynamic dynamic}
63
    {-hscrollmode none none}
64
    {-hscrollmode static static}
65
    {-hscrollmode dynamic dynamic}
66
    {-sbwidth 20 20}
67
    {-scrollmargin 5 5}
68
    {-selectborderwidth 2 2}
69
    {-textbackground GhostWhite GhostWhite}
70
    {-visibleitems 72x40 72x40}
71
    {-height 0 0}
72
    {-width 0 0}
73
    {-wrap char char}
74
    {-wrap none none}
75
    {-unknownimage {} {}}
76
    {-link blue blue}
77
    {-linkhighlight red red}
78
    {-fontname times times}
79
    {-fixedfont courier courier}
80
    {-fontsize medium medium}
81
    {-topics {} {}}
82
    {-title "Test" "Test"} } \
83
    [list [list -helpdir . [pwd]/.]]] {
84
        set option [lindex $test 0]
85
        test Hyperhelp-2.$o "configuration options, $option" {
86
            .h configure $option [lindex $test 1]
87
            lindex [.h configure $option] 4
88
        } [lindex $test 2]
89
        update
90
        incr o
91
}
92
 
93
#
94
# Option tests which fail and produce errors.
95
#
96
foreach test {
97
  {-visibleitems bogus {bad visibleitems option "bogus": should be widthxheight}}
98
  {-hscrollmode bogus {bad hscrollmode option "bogus": should be static, dynamic, or none}}
99
  {-vscrollmode bogus {bad vscrollmode option "bogus": should be static, dynamic, or none}}
100
  {-fontname bogus {Invalid font name "bogus". Must be one of  helvetica courier times symbol}}
101
  {-fontsize bogus {bad fontsize option "bogus": should be small, medium, large, or huge}}
102
  {-fixedfont bogus {Invalid font name "bogus". Must be one of  helvetica courier times symbol}}} {
103
        set option [lindex $test 0]
104
        test Hyperhelp-2.$o "configuration options, $option" {
105
            list [catch {.h configure $option [lindex $test 1]} msg] $msg
106
        } [list 1 [lindex $test 2]]
107
        incr o
108
}
109
 
110
#
111
# Method tests which are successful.
112
#
113
foreach test {
114
    {{.h showtopic hyperhelp} -1}
115
    {{.h followlink scrolledhtml.test#} -1}
116
    {{.h back} -1}
117
    {{.h forward} -1}} {
118
        set method [lindex [lindex $test 0] 1]
119
        test Hyperhelp-3.$m "object methods, $method" {
120
            list [catch {eval [lindex $test 0]} msg] $msg
121
        } [list 0 [lindex $test 1]]
122
        update
123
        incr m
124
}
125
 
126
#
127
# Conclusion of construction/destruction tests
128
#
129
test Hyperhelp-1.$c {Hyperhelp destruction} {
130
    destroy .h
131
    update
132
} {}
133
 
134
incr c
135
 
136
test Hyperhelp-1.$c {Hyperhelp construction} {
137
    hyperhelp .h -topics {index} -helpdir ~/public_html
138
    .h activate
139
    update
140
} {}
141
 
142
incr c
143
 
144
test Hyperhelp-1.$c {Hyperhelp destruction} {
145
    destroy .h
146
    update
147
} {}
148
 
149
incr c
150
 
151
test Hyperhelp-1.$c {Hyperhelp destruction} {
152
    hyperhelp .h
153
    .h activate
154
    .h deactivate
155
    destroy .h
156
    update
157
} {}

powered by: WebSVN 2.1.0

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