File: uiCreateTree.dia.ref

package info (click to toggle)
scilab 5.2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 334,832 kB
  • ctags: 52,586
  • sloc: xml: 526,945; ansic: 223,590; fortran: 163,080; java: 56,934; cpp: 33,840; tcl: 27,936; sh: 20,397; makefile: 9,908; ml: 9,451; perl: 1,323; cs: 614; lisp: 30
file content (252 lines) | stat: -rw-r--r-- 8,042 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2009 - DIGITEO - Sylvestre KOUMAR 
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- TEST WITH TREE -->
// test to check the created tree
// node creation
leaf11 = uiCreateNode('leaf 1.1', 'iconLeaf1.1', 'callbackLeaf1.1')
 leaf11  =
 
 
       leaf11(1)
 
 Tree   
 
       leaf11(2)
 
   label: "leaf 1.1"
   icon: "iconLeaf1.1"
   callback: "callbackLeaf1.1"
leaf12 = uiCreateNode('leaf 1.2', 'iconLeaf1.2', 'callbackLeaf1.2')
 leaf12  =
 
 
       leaf12(1)
 
 Tree   
 
       leaf12(2)
 
   label: "leaf 1.2"
   icon: "iconLeaf1.2"
   callback: "callbackLeaf1.2"
leaf31 = uiCreateNode('leaf 3.1', 'iconLeaf3.1', 'callbackLeaf3.1')
 leaf31  =
 
 
       leaf31(1)
 
 Tree   
 
       leaf31(2)
 
   label: "leaf 3.1"
   icon: "iconLeaf3.1"
   callback: "callbackLeaf3.1"
leaf32 = uiCreateNode('leaf 3.2', 'iconLeaf3.2', 'callbackLeaf3.2')
 leaf32  =
 
 
       leaf32(1)
 
 Tree   
 
       leaf32(2)
 
   label: "leaf 3.2"
   icon: "iconLeaf3.2"
   callback: "callbackLeaf3.2"
node1 = uiCreateNode('Node 1', 'iconNode1', 'callbackNode1')
 node1  =
 
 
       node1(1)
 
 Tree   
 
       node1(2)
 
   label: "Node 1"
   icon: "iconNode1"
   callback: "callbackNode1"
node2 = uiCreateNode('Node 2', 'iconNode2', 'callbackNode2')
 node2  =
 
 
       node2(1)
 
 Tree   
 
       node2(2)
 
   label: "Node 2"
   icon: "iconNode2"
   callback: "callbackNode2"
node3 = uiCreateNode('Node 3', 'iconNode3', 'callbackNode3')
 node3  =
 
 
       node3(1)
 
 Tree   
 
       node3(2)
 
   label: "Node 3"
   icon: "iconNode3"
   callback: "callbackNode3"
root = uiCreateNode('Root', 'iconRoot', 'callbackRoot')
 root  =
 
 
       root(1)
 
 Tree   
 
       root(2)
 
   label: "Root"
   icon: "iconRoot"
   callback: "callbackRoot"
// node creation with errors
if( execstr("myErrorNode1 = uiCreateNode()","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode2 = uiCreateNode(123)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode3 = uiCreateNode(123, ''icon of My Node'')","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode4 = uiCreateNode(''My Node'', 123)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode5 = uiCreateNode(123, ''icon of My Node'', ''callback of My Node'')","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode6 = uiCreateNode(''My Node'', 123, ''callback of My Node'')","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode7 = uiCreateNode(''My Node'', ''icon of My Node'', 123)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode8 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', ''test'')","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myErrorNode9 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', 123)","errcatch") == 0 ) then bugmes();quit;end
// tree creation
treeOnlyNode1 = uiCreateTree(node1)
 treeOnlyNode1  =
 
 
       treeOnlyNode1(1)
 
 Tree   
 
       treeOnlyNode1(2)
 
   label: "Node 1"
   icon: "iconNode1"
   callback: "callbackNode1"
treeNode1 = uiCreateTree(node1, leaf11,leaf12)
 treeNode1  =
 
 
       treeNode1(1)
 
 Tree   
 
       treeNode1(2)
 
   label: "Node 1"
   icon: "iconNode1"
   callback: "callbackNode1"
 
       treeNode1(3)
 
 
        treeNode1(3)(1)
 
 Tree   
 
        treeNode1(3)(2)
 
   label: "leaf 1.1"
   icon: "iconLeaf1.1"
   callback: "callbackLeaf1.1"
treeNode3 = uiCreateTree(node3, leaf31,leaf32)
 treeNode3  =
 
 
       treeNode3(1)
 
 Tree   
 
       treeNode3(2)
 
   label: "Node 3"
   icon: "iconNode3"
   callback: "callbackNode3"
 
       treeNode3(3)
 
 
        treeNode3(3)(1)
 
 Tree   
 
        treeNode3(3)(2)
 
   label: "leaf 3.1"
   icon: "iconLeaf3.1"
   callback: "callbackLeaf3.1"
treeRoot = uiCreateTree(root, node1,node2,node3)
 treeRoot  =
 
 
       treeRoot(1)
 
 Tree   
 
       treeRoot(2)
 
   label: "Root"
   icon: "iconRoot"
   callback: "callbackRoot"
 
       treeRoot(3)
 
 
        treeRoot(3)(1)
 
 Tree   
 
        treeRoot(3)(2)
 
   label: "Node 1"
   icon: "iconNode1"
   callback: "callbackNode1"
// tree creation with wrong inputs
if( execstr("myTree = uiCreateTree()","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(123)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(123, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, 123,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,123,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,node2,123)","errcatch") == 0 ) then bugmes();quit;end
// tree creation with invalid nodes
if( execstr("myTree = uiCreateTree(myErrorNode1)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode2)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode4)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode5)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode6)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode7)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode8)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode9)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode1, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, myErrorNode1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,myErrorNode1,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode1)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode2, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, myErrorNode2,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,myErrorNode2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode2)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode3, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, myErrorNode3,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,myErrorNode3,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode5, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, myErrorNode5,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,myErrorNode5,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode5)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(myErrorNode8, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, myErrorNode8,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,myErrorNode8,node3)","errcatch") == 0 ) then bugmes();quit;end
if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode8)","errcatch") == 0 ) then bugmes();quit;end