Skip to content

Commit

Permalink
tests: Add test for SWF5 function scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Herschel committed May 15, 2022
1 parent d1b65d9 commit eb38b2f
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/tests/regression_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,10 @@ swf_tests! {
(string_ops_swf6, "avm1/string_ops_swf6", 1),
(swf4_bool, "avm1/swf4_bool", 1),
(swf5_encoding, "avm1/swf5_encoding", 1),
(swf5_no_closure, "avm1/swf5_no_closure", 1),
(swf5_to_6_cross_call, "avm1/swf5_to_6_cross_call", 2),
(swf6_case_insensitive, "avm1/swf6_case_insensitive", 1),
(swf6_to_5_cross_call, "avm1/swf6_to_5_cross_call", 2),
(swf7_case_sensitive, "avm1/swf7_case_sensitive", 1),
(target_clip_removed, "avm1/target_clip_removed", 1),
(target_clip_swf5, "avm1/target_clip_swf5", 2),
Expand Down
20 changes: 20 additions & 0 deletions tests/tests/swfs/avm1/swf5_no_closure/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
g() this: _level0
g() _target: /
g() foo: root

root foo:
g

clip g():
g() this: _level0.clip
g() _target: /clip
g() foo: clip foo

clip foo:
g

object g():
g() this: [object Object]
g() _target: /
g() foo: g

Binary file added tests/tests/swfs/avm1/swf5_no_closure/test.fla
Binary file not shown.
Binary file added tests/tests/swfs/avm1/swf5_no_closure/test.swf
Binary file not shown.
Binary file not shown.
Binary file added tests/tests/swfs/avm1/swf5_to_6_cross_call/child.swf
Binary file not shown.
30 changes: 30 additions & 0 deletions tests/tests/swfs/avm1/swf5_to_6_cross_call/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
child f():
this: _level0.clip
_target: /clip
getDepth: [type Function]
foo: child foo

child obj toString:
this: object
_target: /clip
getDepth: [type Function]
foo: child foo

clip.f():
this: _level0.clip
_target: /clip
getDepth: [type Function]
foo: child foo

_root f():
this: object
_target: /
getDepth:
foo:

root obj toString:
this: object
_target: /clip
getDepth: [type Function]
foo: child foo

Binary file not shown.
Binary file added tests/tests/swfs/avm1/swf5_to_6_cross_call/test.swf
Binary file not shown.
Binary file not shown.
Binary file added tests/tests/swfs/avm1/swf6_to_5_cross_call/child.swf
Binary file not shown.
30 changes: 30 additions & 0 deletions tests/tests/swfs/avm1/swf6_to_5_cross_call/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
child f():
this: _level0.clip
_target: /clip
getDepth:
foo: child foo

child obj toString:
this: object
_target: /clip
getDepth:
foo: child foo

clip.f():
this: _level0.clip
_target: /clip
getDepth:
foo: child foo

_root f():
this: object
_target: /clip
getDepth:
foo: child foo

root obj toString:
this: object
_target: /clip
getDepth:
foo: child foo

Binary file not shown.
Binary file added tests/tests/swfs/avm1/swf6_to_5_cross_call/test.swf
Binary file not shown.

0 comments on commit eb38b2f

Please sign in to comment.