tests: Add a test for floating point errors in the AVM1 representation of `_xscale`, `_yscale`, and `_rotation`.

This commit is contained in:
David Wendt 2020-09-25 18:50:05 -04:00 committed by Mike Welsh
parent 2fc5e6f92e
commit f6f084098e
4 changed files with 587 additions and 0 deletions

View File

@ -383,6 +383,7 @@ swf_tests! {
(as3_array_sort, "avm2/array_sort", 1),
(as3_array_sorton, "avm2/array_sorton", 1),
(as3_array_hasownproperty, "avm2/array_hasownproperty", 1),
(stage_property_representation, "avm1/stage_property_representation", 1),
}
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.

View File

@ -0,0 +1,586 @@
//(xscale = 20 through 420)
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180
182
184
186
188
190
192
194
196
198
200
202
204
206
208
210
212
214
216
218
220
222
224
226
228
230
232
234
236
238
240
242
244
246
248
250
252
254
256
258
260
262
264
266
268
270
272
274
276
278
280
282
284
286
288
290
292
294
296
298
300
302
304
306
308
310
312
314
316
318
320
322
324
326
328
330
332
334
336
338
340
342
344
346
348
350
352
354
356
358
360
362
364
366
368
370
372
374
376
378
380
382
384
386
388
390
392
394
396
398
400
402
404
406
408
410
412
414
416
418
420
//(_yscale = 20 through 420)
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180
182
184
186
188
190
192
194
196
198
200
202
204
206
208
210
212
214
216
218
220
222
224
226
228
230
232
234
236
238
240
242
244
246
248
250
252
254
256
258
260
262
264
266
268
270
272
274
276
278
280
282
284
286
288
290
292
294
296
298
300
302
304
306
308
310
312
314
316
318
320
322
324
326
328
330
332
334
336
338
340
342
344
346
348
350
352
354
356
358
360
362
364
366
368
370
372
374
376
378
380
382
384
386
388
390
392
394
396
398
400
402
404
406
408
410
412
414
416
418
420
//(_rotation = 180 through 180)
180
-178
-176
-174
-172
-170
-168
-166
-164
-162
-160
-158
-156
-154
-152
-150
-148
-146
-144
-142
-140
-138
-136
-134
-132
-130
-128
-126
-124
-122
-120
-118
-116
-114
-112
-110
-108
-106
-104
-102
-100
-98
-96
-94
-92
-90
-88
-86
-84
-82
-80
-78
-76
-74
-72
-70
-68
-66
-64
-62
-60
-58
-56
-54
-52
-50
-48
-46
-44
-42
-40
-38
-36
-34
-32
-30
-28
-26
-24
-22
-20
-18
-16
-14
-12
-10
-8
-6
-4
-2
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180