tests: Add more stringent height/width test that we're only accurate to within 1 twip.

This commit is contained in:
David Wendt 2020-11-27 18:49:47 -05:00 committed by Mike Welsh
parent abca120628
commit 4784dc3c03
7 changed files with 2738 additions and 1502 deletions

View File

@ -453,6 +453,8 @@ swf_tests_approx! {
(as3_coerce_string_precision, "avm2/coerce_string_precision", 1, max_relative = 30.0 * std::f64::EPSILON),
(as3_divide, "avm2/divide", 1, epsilon = 0.0), // TODO: Discrepancy in float formatting.
(as3_math, "avm2/math", 1, max_relative = 30.0 * std::f64::EPSILON),
(as3_displayobject_height, "avm2/displayobject_height", 7, epsilon = 0.06), // TODO: height/width appears to be off by 1 twip sometimes
(as3_displayobject_width, "avm2/displayobject_width", 7, epsilon = 0.06),
}
#[test]

File diff suppressed because it is too large Load Diff

View File

@ -8,23 +8,40 @@
//this.scaleX;
1
//this.width = 400;
//this.width;
400
//this.scaleX;
0.7272727272727273
//this.width = 0;
//this.width;
0
//this.scaleX;
0
//this.scaleX = 1.0;
//this.width;
550
//this.scaleX;
1
//this.scaleX = -0.5;
//this.width;
275
//this.scaleX;
-0.5
//this.width = -400;
//this.width;
275
//this.scaleX;
-0.5
//this.width = 400;
//this.width;
400
//this.scaleX;
0.7272727272727273
//this.scaleX = 107;
//this.width;
58850
//this.scaleX;
107
//this.width = 0;
//this.scaleX;
0
@ -1632,7 +1649,7 @@
//this.scaleX = -1.0;
//this.width;
550
//(scaleX ramp from -1.0 to 1.0 in 1px steps
//(scaleX ramp from -1.0 to 1.0 in 2.5% steps
//this.width;
548.6
//this.scaleX;