AS1/2 direct editation - reordering of large (>256 items) constantpools

This commit is contained in:
Jindra Petřík
2018-01-21 13:03:20 +01:00
parent 9e2497f2b8
commit 2f6d0e66ac
3 changed files with 111 additions and 43 deletions

View File

@@ -12,10 +12,12 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash;
import com.jpexs.decompiler.flash.action.parser.script.ActionScript2Parser;
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.graph.CompilationException;
import java.io.IOException;
@@ -91,4 +93,22 @@ public class ActionScript2ParserTest extends ActionScript2TestBase {
+ " };\n"
+ "}");
}
@Test
private void testAS2SimpleConstantPoolOrder() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < ActionPush.MAX_CONSTANT_INDEX_TYPE8; i++) {
sb.append("trace(\"" + i + "\");\n");
}
parseAS2(sb.toString());
}
@Test
private void testAS2LargeConstantPoolOrder() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < ActionPush.MAX_CONSTANT_INDEX_TYPE8 + 100; i++) {
sb.append("trace(\"" + i + "\");\n");
}
parseAS2(sb.toString());
}
}