Skip to content

Commit

Permalink
tests: Add test for SharedObject.clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Herschel authored and Aaron1011 committed Mar 27, 2023
1 parent a7bd373 commit 87dad70
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/tests/swfs/avm2/shared_object/Test.as
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@
trace()
trace("otherObj dump:")
dump(otherObj.data.props)

// Test SharedObject.clear()
trace();
var previousData = obj.data;
trace("obj.clear()");
obj.clear();
trace("obj == previousData: " + (obj.data == previousData));

trace();
trace("obj dump:");
dump(obj.data);

trace();
trace("obj dump again:");
obj = SharedObject.getLocal("RuffleTest", "/");
dump(obj.data);
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions tests/tests/swfs/avm2/shared_object/output2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ otherObj dump:
6 = elem0,,,,elem4 type object
7 = 1,2,3 type object
8 = (UTC) Sun Jan 25 20:31:23 1970 UTC

obj.clear()
obj == previousData: false

obj dump:

obj dump again:
Binary file modified tests/tests/swfs/avm2/shared_object/test.swf
Binary file not shown.

0 comments on commit 87dad70

Please sign in to comment.