author | Jan Vrany <jan.vrany@labware.com> |
Mon, 08 Mar 2021 11:25:35 +0000 | |
branch | jv |
changeset 2594 | e5f39c0a5bd6 |
parent 1567 | e17701a073f9 |
permissions | -rwxr-xr-x |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
211 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
ApplicationModel subclass:#WrongMethodCalledTest |
|
6 |
instanceVariableNames:'vh1 vh2 updateProcess' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
584 | 9 |
category:'tests-Regression' |
211 | 10 |
! |
11 |
||
12 |
View subclass:#GraphicTestView |
|
13 |
instanceVariableNames:'' |
|
14 |
classVariableNames:'' |
|
15 |
poolDictionaries:'' |
|
16 |
privateIn:WrongMethodCalledTest |
|
17 |
! |
|
18 |
||
19 |
!WrongMethodCalledTest class methodsFor:'documentation'! |
|
20 |
||
21 |
documentation |
|
22 |
" |
|
23 |
Run this multiple times with JIT turned off. |
|
24 |
||
25 |
In ST/X rel < 5.1.2, Sooner or later, the paint method |
|
26 |
will be invoked (illegally) via the fillRectangle selector |
|
27 |
and vice versa. |
|
28 |
" |
|
29 |
! ! |
|
30 |
||
31 |
!WrongMethodCalledTest class methodsFor:'interface specs'! |
|
32 |
||
33 |
windowSpec |
|
34 |
"This resource specification was automatically generated |
|
35 |
by the UIPainter of ST/X." |
|
36 |
||
37 |
"Do not manually edit this!! If it is corrupted, |
|
38 |
the UIPainter may not be able to read the specification." |
|
39 |
||
40 |
" |
|
41 |
UIPainter new openOnClass:NewApplication1 andSelector:#windowSpec |
|
42 |
NewApplication1 new openInterface:#windowSpec |
|
43 |
NewApplication1 open |
|
44 |
" |
|
45 |
||
46 |
<resource: #canvas> |
|
47 |
||
1447 | 48 |
^ |
211 | 49 |
#(FullSpec |
1447 | 50 |
name: windowSpec |
51 |
window: |
|
211 | 52 |
(WindowSpec |
1447 | 53 |
label: 'NewApplication1' |
54 |
name: 'NewApplication1' |
|
55 |
min: (Point 10 10) |
|
56 |
max: (Point 1024 768) |
|
57 |
bounds: (Rectangle 12 22 312 322) |
|
58 |
menu: mainMenu |
|
59 |
) |
|
60 |
component: |
|
211 | 61 |
(SpecCollection |
1447 | 62 |
collection: ( |
63 |
(NonScrollableArbitraryComponentSpec |
|
64 |
name: 'NonScrollableArbitraryComponent1' |
|
65 |
layout: (LayoutFrame 6 0 4 0 285 0 93 0) |
|
66 |
model: vh2 |
|
67 |
component: GraphicTestView |
|
68 |
) |
|
69 |
(InputFieldSpec |
|
70 |
name: 'EntryField1' |
|
71 |
layout: (LayoutFrame 14 0 181 0 219 0 203 0) |
|
72 |
model: vh1 |
|
73 |
type: number |
|
74 |
acceptOnReturn: true |
|
75 |
acceptOnTab: true |
|
76 |
acceptOnLostFocus: true |
|
77 |
acceptOnPointerLeave: false |
|
78 |
) |
|
79 |
(InputFieldSpec |
|
80 |
name: 'EntryField2' |
|
81 |
layout: (LayoutFrame 14 0 144 0 219 0 166 0) |
|
82 |
model: vh1 |
|
83 |
type: number |
|
84 |
acceptOnReturn: true |
|
85 |
acceptOnTab: true |
|
86 |
acceptOnLostFocus: true |
|
87 |
acceptOnPointerLeave: false |
|
88 |
) |
|
89 |
(InputFieldSpec |
|
90 |
name: 'EntryField3' |
|
91 |
layout: (LayoutFrame 14 0 107 0 219 0 129 0) |
|
92 |
model: vh1 |
|
93 |
type: number |
|
94 |
acceptOnReturn: true |
|
95 |
acceptOnTab: true |
|
96 |
acceptOnLostFocus: true |
|
97 |
acceptOnPointerLeave: false |
|
98 |
) |
|
99 |
(InputFieldSpec |
|
100 |
name: 'EntryField4' |
|
101 |
layout: (LayoutFrame 14 0 218 0 219 0 240 0) |
|
102 |
model: vh1 |
|
103 |
type: number |
|
104 |
acceptOnReturn: true |
|
105 |
acceptOnTab: true |
|
106 |
acceptOnLostFocus: true |
|
107 |
acceptOnPointerLeave: false |
|
108 |
) |
|
109 |
(InputFieldSpec |
|
110 |
name: 'EntryField5' |
|
111 |
layout: (LayoutFrame 14 0 255 0 219 0 277 0) |
|
112 |
model: vh1 |
|
113 |
type: number |
|
114 |
acceptOnReturn: true |
|
115 |
acceptOnTab: true |
|
116 |
acceptOnLostFocus: true |
|
117 |
acceptOnPointerLeave: false |
|
118 |
) |
|
119 |
) |
|
120 |
||
121 |
) |
|
211 | 122 |
) |
123 |
! ! |
|
124 |
||
125 |
!WrongMethodCalledTest class methodsFor:'menu specs'! |
|
126 |
||
127 |
mainMenu |
|
128 |
"This resource specification was automatically generated |
|
129 |
by the MenuEditor of ST/X." |
|
130 |
||
131 |
"Do not manually edit this!! If it is corrupted, |
|
132 |
the MenuEditor may not be able to read the specification." |
|
133 |
||
134 |
" |
|
135 |
MenuEditor new openOnClass:RegressionTests::WrongMethodCalledTest andSelector:#mainMenu |
|
136 |
(Menu new fromLiteralArrayEncoding:(RegressionTests::WrongMethodCalledTest mainMenu)) startUp |
|
137 |
" |
|
138 |
||
139 |
<resource: #menu> |
|
140 |
||
1447 | 141 |
^ |
211 | 142 |
#(Menu |
1447 | 143 |
( |
144 |
(MenuItem |
|
145 |
label: 'File' |
|
146 |
translateLabel: true |
|
147 |
submenu: |
|
148 |
(Menu |
|
149 |
( |
|
150 |
(MenuItem |
|
151 |
label: 'Exit' |
|
152 |
itemValue: closeRequest |
|
153 |
translateLabel: true |
|
154 |
) |
|
155 |
) |
|
156 |
nil |
|
157 |
nil |
|
158 |
) |
|
159 |
) |
|
160 |
) |
|
161 |
nil |
|
162 |
nil |
|
211 | 163 |
) |
164 |
! ! |
|
165 |
||
584 | 166 |
!WrongMethodCalledTest class methodsFor:'others'! |
167 |
||
168 |
version_CVS |
|
169 |
^ '$Header$' |
|
170 |
! ! |
|
171 |
||
211 | 172 |
!WrongMethodCalledTest methodsFor:'aspects'! |
173 |
||
174 |
vh1 |
|
175 |
"automatically generated by UIPainter ..." |
|
176 |
||
177 |
"*** the code below creates a default model when invoked." |
|
178 |
"*** (which may not be the one you wanted)" |
|
179 |
"*** Please change as required and accept it in the browser." |
|
180 |
"*** (and replace this comment by something more useful ;-)" |
|
181 |
||
182 |
vh1 isNil ifTrue:[ |
|
1447 | 183 |
vh1 := 1 asValue |
211 | 184 |
]. |
185 |
^ vh1. |
|
186 |
! |
|
187 |
||
188 |
vh2 |
|
189 |
"automatically generated by UIPainter ..." |
|
190 |
||
191 |
"*** the code below creates a default model when invoked." |
|
192 |
"*** (which may not be the one you wanted)" |
|
193 |
"*** Please change as required and accept it in the browser." |
|
194 |
"*** (and replace this comment by something more useful ;-)" |
|
195 |
||
196 |
vh2 isNil ifTrue:[ |
|
1447 | 197 |
vh2 := 1 asValue |
211 | 198 |
]. |
199 |
^ vh2. |
|
200 |
! ! |
|
201 |
||
202 |
!WrongMethodCalledTest methodsFor:'initialization & release'! |
|
203 |
||
204 |
closeRequest |
|
205 |
updateProcess terminate. |
|
206 |
super closeRequest. |
|
207 |
! |
|
208 |
||
209 |
postBuildWith:aBuilder |
|
210 |
|val| |
|
211 |
||
212 |
super postBuildWith:aBuilder. |
|
213 |
||
214 |
updateProcess := [ |
|
1447 | 215 |
[self window realized] whileTrue:[ |
216 |
val := self vh1 value. |
|
217 |
val := (val + 1) \\ 100. |
|
218 |
self vh1 value:val. |
|
211 | 219 |
|
1447 | 220 |
val := self vh2 value. |
221 |
val := (val + 1) \\ 100. |
|
222 |
self vh2 value:val. |
|
223 |
]. |
|
211 | 224 |
] forkAt:4. |
225 |
! ! |
|
226 |
||
227 |
!WrongMethodCalledTest::GraphicTestView methodsFor:'change & update'! |
|
228 |
||
229 |
redraw |
|
230 |
self paint:Color red. |
|
231 |
self fillRectangle:(Rectangle origin:0@0 corner:30@40). |
|
232 |
! |
|
233 |
||
234 |
update:something with:aParameter from:where |
|
235 |
self redraw |
|
236 |
! ! |
|
237 |
||
238 |
!WrongMethodCalledTest class methodsFor:'documentation'! |
|
239 |
||
240 |
version |
|
241 |
^ '$Header$' |
|
242 |
! ! |
|
1567
e17701a073f9
Added abstract VMSpawningTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
243 |