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);