DataProvider in tests for ASC2 compiled SWF

This commit is contained in:
Jindra Petřík
2021-01-29 10:53:53 +01:00
parent 0eff854a49
commit 6aad6052b3
9 changed files with 332 additions and 310 deletions

View File

@@ -12,7 +12,8 @@
* 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.generators;
import com.jpexs.decompiler.flash.SWF;
@@ -76,11 +77,21 @@ public class AS3Generator {
continue;
}
if (name.equals("run")) {
if (name.equals("run")) {
if (identifier.equals("standard")) {
s.append("@Test(dataProvider = \"standardSwfNamesProvider\")\r\n");
} else {
s.append("@Test\r\n");
}
s.append("public void ");
s.append(testMethodName);
s.append(testMethodName);
s.append("(){\r\ndecompileMethod(\"");
s.append(identifier);
if (identifier.equals("standard")) {
s.append("(String swfUsed){\r\ndecompileMethod(swfUsed");
} else {
s.append("(){\r\ndecompileMethod(\"");
s.append(identifier);
s.append("\"");
}
s.append(",\"");
s.append(lower);
s.append("\", ");
HighlightedTextWriter src = new HighlightedTextWriter(new CodeFormatting(), false);

View File

@@ -12,6 +12,7 @@
<movie minorVersion="0" />
<movie platform="Flash Player" />
<movie background="#FFFFFF" />
<movie preferredSDK="AIR 33.1.1;33.1.1;" />
</output>
<!-- Other classes to be compiled into your SWF -->
<classpaths>
@@ -27,8 +28,8 @@
<option inline="False" />
<option locale="" />
<option loadConfig="" />
<option optimize="True" />
<option omitTraces="True" />
<option optimize="False" />
<option omitTraces="False" />
<option showActionScriptWarnings="True" />
<option showBindingWarnings="True" />
<option showInvalidCSS="True" />

View File

@@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'26.01.2021'</value>
<value>'29.01.2021'</value>
</define>
<define append="true">
<name>CONFIG::air</name>

View File

@@ -3,8 +3,6 @@
<!--Any modifications you make may be lost.-->
<flex-config>
<target-player>25.0</target-player>
<benchmark>false</benchmark>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<compiler>
<define append="true">
<name>CONFIG::debug</name>
@@ -16,7 +14,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
<value>'26.01.2021'</value>
<value>'29.01.2021'</value>
</define>
<define append="true">
<name>CONFIG::air</name>

View File

@@ -8,7 +8,8 @@ package tests
var v:Vector.<String> = new Vector.<String>();
v.push("hello");
v[0] = "hi";
v[5 * 8 - 39] = "hi2";
var a:int = 5;
v[a * 8 - 39] = "hi2";
trace(v[0]);
}
}