diff --git a/core/tests/regression_tests.rs b/core/tests/regression_tests.rs index 23dd304c9..946839198 100644 --- a/core/tests/regression_tests.rs +++ b/core/tests/regression_tests.rs @@ -178,11 +178,13 @@ swf_tests! { } // TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough. -// Eventually we can hopefully make these match exactly (see #193). +// Eventually we can hopefully make some of these match exactly (see #193). +// Some will probably always need to be approx. (if they rely on trig functions, etc.) swf_tests_approx! { (local_to_global, "avm1/local_to_global", 1, 0.4), (stage_object_properties, "avm1/stage_object_properties", 4, 0.051), (stage_object_properties_swf6, "avm1/stage_object_properties_swf6", 4, 0.051), + (movieclip_getbounds, "avm1/movieclip_getbounds", 1, 0.1), } #[test] diff --git a/core/tests/swfs/avm1/movieclip_getbounds/output.txt b/core/tests/swfs/avm1/movieclip_getbounds/output.txt new file mode 100644 index 000000000..2d77b7b83 --- /dev/null +++ b/core/tests/swfs/avm1/movieclip_getbounds/output.txt @@ -0,0 +1,84 @@ +// clip.clip.getBounds() +-50 +-112 +154.95 +50 + +// clip.clip.getBounds(clip.clip) +-50 +-112 +154.95 +50 + +// clip.clip.getBounds(clip.clip) +-50 +-112 +154.95 +50 + +// clip.clip.getBounds(clip.clip.clip) +-154.95 +-100 +50 +471.9 + +// clip.clip.getBounds(clip) +-35.35 +-57.25 +94.4 +72.5 + +// clip.clip.getBounds(_root) +99.95 +100 +261.95 +304.95 + +// clip.clip.getBounds(clip2) +-124.65 +210.05 +145.75 +469.5 + +// clip.getBounds('/') +3.5 +50 +308.4 +354.9 + +// clip.getBounds('/clip') +-35.35 +-35.35 +76.7 +68.2 + +// clip.getBounds('clip:clip') +-204.95 +-99.9 +99.95 +521.9 + +// clip3.getBounds(undefined) +-119.8 +-89.8 +50 +68 + +// clip3.getBounds(o) +-5.8 +-107.8 +164 +50 + +// clip.clip.getBounds(undefined) +undefined + +// clip.clip.getBounds(undefined) +undefined + +// clip.getBounds('') +undefined + +// clip.clip.getBounds('clip.clip') +undefined + diff --git a/core/tests/swfs/avm1/movieclip_getbounds/test.fla b/core/tests/swfs/avm1/movieclip_getbounds/test.fla new file mode 100644 index 000000000..7041e570d Binary files /dev/null and b/core/tests/swfs/avm1/movieclip_getbounds/test.fla differ diff --git a/core/tests/swfs/avm1/movieclip_getbounds/test.swf b/core/tests/swfs/avm1/movieclip_getbounds/test.swf new file mode 100644 index 000000000..7c6f59ee2 Binary files /dev/null and b/core/tests/swfs/avm1/movieclip_getbounds/test.swf differ